CN112995066B - Frame data processing method and device, electronic equipment and storage medium - Google Patents

Frame data processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112995066B
CN112995066B CN202110168008.9A CN202110168008A CN112995066B CN 112995066 B CN112995066 B CN 112995066B CN 202110168008 A CN202110168008 A CN 202110168008A CN 112995066 B CN112995066 B CN 112995066B
Authority
CN
China
Prior art keywords
data
frame
processed
frame data
analyzed
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
CN202110168008.9A
Other languages
Chinese (zh)
Other versions
CN112995066A (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.)
SUNTRONT TECH CO LTD
Original Assignee
SUNTRONT TECH 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 SUNTRONT TECH CO LTD filed Critical SUNTRONT TECH CO LTD
Priority to CN202110168008.9A priority Critical patent/CN112995066B/en
Publication of CN112995066A publication Critical patent/CN112995066A/en
Application granted granted Critical
Publication of CN112995066B publication Critical patent/CN112995066B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/622Queue service order
    • GPHYSICS
    • G08SIGNALLING
    • G08CTRANSMISSION SYSTEMS FOR MEASURED VALUES, CONTROL OR SIMILAR SIGNALS
    • G08C19/00Electric signal transmission systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a frame data processing method, a frame data processing device, electronic equipment and a storage medium, and relates to the technical field of data processing. The frame data processing method comprises the following steps: combining the frame data in the frame data queue to be analyzed to obtain combined frame data, and emptying the frame data queue to be analyzed; reading at least one complete frame from the combined frame data according to a preset starting mark and an ending mark, and determining that the frame data is read, wherein the complete frame has a preset length; if the incomplete frames exist in the combined frame data after the frame data reading is determined to be completed, the incomplete frames are added to a frame data queue to be analyzed. In the embodiment of the application, frame breaking processing is carried out on the combined frame data through a preset starting mark and an ending mark to obtain complete frame data; and adding the processed incomplete frames to a frame data queue to be analyzed, and combining the processed incomplete frames with the new data after acquiring the new data, thereby improving the utilization rate of the data and the reading efficiency.

Description

Frame data processing method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a frame data processing method, device, electronic apparatus, and storage medium.
Background
With the increasing development and perfection of domestic intelligent systems, remote meter reading systems are installed in most communities or villages, and the systems play a quite important role as important components of modern management systems.
In the meter reading process, if the conditions of high concurrency or poor network signals are met, the remote meter reading system may receive a plurality of frame adhesion or incomplete frame data, at this time, the meter reading system discards the missing data in order to ensure the accuracy of the data read back, and maintenance personnel are required to manually repair the missing data to perfect the missing data, so that great workload is brought to the maintenance personnel.
The existing meter reading method has low meter reading efficiency.
Disclosure of Invention
In order to solve the problems in the prior art, the application provides a frame data processing method, a frame data processing device, electronic equipment and a storage medium.
The first aspect of the present application provides a frame data processing method, including:
combining the frame data in the frame data queue to be analyzed to obtain combined frame data, and emptying the frame data queue to be analyzed, wherein the frame data in the frame data queue to be analyzed comprises the following components: frame data transmitted by a transmitting device;
reading at least one complete frame from the combined frame data according to a preset starting mark and an ending mark, and determining that frame data reading is finished, wherein the complete frame has a preset length;
and if the incomplete frames exist in the combined frame data after the frame data are read, adding the incomplete frames to the frame data queue to be analyzed.
Optionally, the reading at least one complete frame from the combined frame data according to a preset start flag and an end flag includes:
taking the combined frame data as initial data to be processed;
A. determining whether the data to be processed contains a complete frame according to whether the data to be processed contains the preset starting mark and the preset ending mark;
B. if yes, taking the data between the start mark and the end mark in the data to be processed as the contained complete frame, adding the contained complete frame into a complete frame queue, and deleting the contained complete frame from the data to be processed to obtain new data to be processed;
C. if not, determining whether frame data reading is completed or not according to the length of the data to be processed;
D. if the frame data reading is determined to be completed, ending;
E. if the fact that the frame data are not completely read and the data to be processed do not contain the end mark is determined, deleting the first start mark in the data to be processed to obtain new data to be processed;
and (3) circularly executing the steps A-E until the length of the data to be processed is 0.
Optionally, the determining whether the data to be processed includes a complete frame according to whether the data to be processed includes the preset start flag and the preset end flag includes:
judging whether the data to be processed contains the initial mark or not;
if yes, determining whether the data to be processed contains a complete frame according to the length of the data to be processed and the ending mark.
Optionally, the determining whether the data to be processed includes a complete frame according to the length of the data to be processed and the end flag includes:
if the length of the data to be processed is greater than or equal to the preset length and the data to be processed contains the end mark, determining that the data to be processed contains a complete frame.
Optionally, before determining whether the to-be-processed data includes the complete frame according to the length of the to-be-processed data and the end flag, the method further includes:
deleting the data before the start mark from the data to be processed.
Optionally, after the adding the incomplete frame to the frame data queue to be analyzed, the method further includes:
receiving frame data sent by a sending device;
and combining the frame data sent by the sending equipment with the incomplete frame to obtain a new frame data queue to be analyzed.
Optionally, the merging the frame data sent by the sending device with the incomplete frame to obtain a new frame data queue to be analyzed includes:
and splicing the frame data sent by the sending equipment to the tail end of the incomplete frame to obtain a new frame data queue to be analyzed.
A second aspect of the present application provides a frame data processing apparatus comprising: the device comprises a merging unit, a reading unit and an adding unit;
the merging unit is configured to merge frame data in a frame data queue to be analyzed to obtain merged frame data, and empty the frame data queue to be analyzed, where the frame data in the frame data queue to be analyzed includes: frame data transmitted by a transmitting device;
the reading unit is used for reading at least one complete frame from the combined frame data according to a preset starting mark and an ending mark, and determining that the frame data is read, wherein the complete frame has a preset length;
and the adding unit is used for adding the incomplete frame to the frame data queue to be analyzed if the incomplete frame exists in the combined frame data after the frame data is determined to be read.
Optionally, the reading unit is configured to take the combined frame data as initial data to be processed;
A. determining whether the data to be processed contains a complete frame according to whether the data to be processed contains the preset starting mark and the preset ending mark;
B. if yes, taking the data between the start mark and the end mark in the data to be processed as the contained complete frame, adding the contained complete frame into a complete frame queue, and deleting the contained complete frame from the data to be processed to obtain new data to be processed;
C. if not, determining whether frame data reading is completed or not according to the length of the data to be processed;
D. if the frame data reading is determined to be completed, ending;
E. if the fact that the frame data are not completely read and the data to be processed do not contain the end mark is determined, deleting the first start mark in the data to be processed to obtain new data to be processed;
and (3) circularly executing the steps A-E until the length of the data to be processed is 0.
Optionally, the reading unit is configured to determine whether the data to be processed includes the start flag;
if yes, determining whether the data to be processed contains a complete frame according to the length of the data to be processed and the ending mark.
Optionally, the reading unit is configured to determine that the data to be processed includes a complete frame if the length of the data to be processed is greater than or equal to the preset length and the data to be processed includes the end flag.
Optionally, the apparatus further comprises: a deletion unit;
the deleting unit is used for deleting the data before the start mark from the data to be processed.
Optionally, the apparatus further comprises: a receiving unit;
the receiving unit is used for receiving the frame data sent by the sending equipment;
and the merging unit is used for merging the frame data sent by the sending equipment with the incomplete frame to obtain a new frame data queue to be analyzed.
Optionally, the merging unit is configured to splice the frame data sent by the sending device to the end of the incomplete frame, so as to obtain a new frame data queue to be analyzed.
A third aspect of the present application provides an electronic apparatus, comprising: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating over the bus when the electronic device is operating, the processor executing the machine-readable instructions to perform the steps of the method as described in the first aspect above.
A fourth aspect of the application provides a storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method according to the first aspect described above.
In a frame data processing method, a device, an electronic device and a storage medium provided in an embodiment of the present application, the frame data processing method includes: combining the frame data in the frame data queue to be analyzed to obtain combined frame data, and emptying the frame data queue to be analyzed, wherein the frame data in the frame data queue to be analyzed comprises the following components: frame data transmitted by a transmitting device; reading at least one complete frame from the combined frame data according to a preset starting mark and an ending mark, and determining that frame data reading is finished, wherein the complete frame has a preset length; and if the incomplete frames exist in the combined frame data after the frame data are read, adding the incomplete frames to the frame data queue to be analyzed. In the embodiment of the application, frame breaking processing is carried out on the combined frame data through a preset starting mark and an ending mark to obtain complete frame data; and adding the processed incomplete frame to a frame data queue to be analyzed, so that the incomplete frame and the new frame data can be combined after the new frame data is acquired, and then the complete frame data is acquired, thereby improving the utilization rate of the data and the reading efficiency.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a diagram of a frame data processing system according to an embodiment of the present application;
FIG. 2 is a flow chart illustrating a frame data processing method according to an embodiment of the present application;
FIG. 3 is a flow chart illustrating a frame data processing method according to another embodiment of the present application;
FIG. 4 is a flowchart illustrating a frame data processing method according to another embodiment of the present application;
FIG. 5 is a flowchart illustrating an overall frame data processing method according to another embodiment of the present application;
FIG. 6 is a schematic diagram of a frame data processing apparatus according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a frame data processing apparatus according to another embodiment of the present application;
FIG. 8 is a schematic diagram of a frame data processing apparatus according to another embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for the purpose of illustration and description only and are not intended to limit the scope of the present application. In addition, it should be understood that the schematic drawings are not drawn to scale. A flowchart, as used in this disclosure, illustrates operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be implemented out of order and that steps without logical context may be performed in reverse order or concurrently. Moreover, one or more other operations may be added to or removed from the flow diagrams by those skilled in the art under the direction of the present disclosure.
In addition, the described embodiments are only some, but not all, embodiments of the application. The components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present application.
It should be noted that the term "comprising" will be used in embodiments of the application to indicate the presence of the features stated hereafter, but not to exclude the addition of other features.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
Furthermore, the terms first, second and the like in the description and in the claims and in the above-described figures, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the features of the embodiments of the present application may be combined with each other without conflict.
With the increasing development and perfection of domestic intelligent systems, remote meter reading systems are installed in most communities or villages, and the systems play a quite important role as important components of modern management systems. In the meter reading process, if the conditions of high concurrency or poor network signals are met, the remote meter reading system may receive a plurality of frame adhesion or incomplete frame data, at this time, the meter reading system discards the missing data in order to ensure the accuracy of the data read back, and maintenance personnel are required to manually repair the missing data to perfect the missing data, so that great workload is brought to the maintenance personnel.
In order to solve the technical problems existing in the prior art, the application provides an application conception: the frame breaking processing is carried out on the combined frame data through a preset starting mark and an ending mark, so that complete frame data are obtained; and adding the processed incomplete frame to a frame data queue to be analyzed, so that the incomplete frame and the new frame data can be combined after the new frame data is acquired, and then the complete frame data is acquired, thereby improving the utilization rate of the data and the reading efficiency.
The following describes the specific technical scheme provided by the application through possible implementation modes.
FIG. 1 is a schematic diagram of a frame data processing system according to an embodiment of the present application, as shown in FIG. 1, the frame data processing system includes: server 1, concentrator 2, and spread spectrum table 3, server 1 is communicatively coupled to concentrator 2 for acquiring data in concentrator 2. The concentrators 2 are communicatively connected to the spread spectrum table 3, and one concentrator 2 may obtain a field, for example: all of the data information of table 3 is spread across one floor. The spread spectrum table 3 is equipment with high sensitivity and long communication distance based on spread spectrum communication technology, and has the functions of metering and counting money, supporting active uploading of meter reading data, alarming to a nearby concentrator 2 and the like. The concentrator 2 is a central management device of the frame data processing system, and is responsible for timing reading data of the spread spectrum table 3, command transmission of the server 1, and further has functions of data communication, network management, event recording, lateral transmission of data, and the like. The server 1 is configured to analyze data acquired from the concentrator 2, and further has a function of issuing a meter reading command to the spread spectrum table 3 via the concentrator 2.
Fig. 2 is a flow chart of a frame data processing method according to an embodiment of the present application, where an execution subject of the method may be a computer, a server, or other devices with processing functions. As shown in fig. 2, the method includes:
s201, combining the frame data in the frame data queue to be analyzed to obtain combined frame data, and emptying the frame data queue to be analyzed.
The frame data in the frame data queue to be analyzed may include new frame data received this time, or incomplete frame data obtained after data frame processing is performed on frame data received last time. It should be noted that, in the embodiment of the present application, the data processing, including merging, emptying, etc., is performed on the server 1.
The frame data in the frame data queue to be analyzed includes: frame data transmitted by the transmitting device.
In one implementation, when the server directly communicates with the spreading tables, the sending device is the spreading tables, and the frame data sent by the sending device is the data sent by each spreading table to the server at a certain moment. In another implementation, when the server communicates data with the spread spectrum table through the concentrators, the sending device is the concentrators, and the frame data sent by the sending device is the data sent by each concentrator to the server.
S202, reading at least one complete frame from the combined frame data according to a preset start mark and an end mark, and determining that the frame data is read.
Wherein the complete frame has a preset length. Illustratively, the full frame length may be 18 characters.
The preset start and end flags may be a string of flag character strings, such as: the preset start flag may be 44 in 16 and the preset end flag may be 10 in 16.
The judgment as to whether or not the reading of the frame data is completed may be determined by the data length of the remaining frames.
S203, if it is determined that incomplete frames exist in the combined frame data after the frame data are read, the incomplete frames are added to a frame data queue to be analyzed.
In the embodiment of the application, after the frame data is read, residual frame data still exists in the combined frame data, and the length of the residual frame data is not 0, determining that an incomplete frame exists in the combined frame data, and adding the incomplete frame to a frame data queue to be analyzed.
The frame data processing method provided by the embodiment of the application comprises the following steps: combining the frame data in the frame data queue to be analyzed to obtain combined frame data, and emptying the frame data queue to be analyzed, wherein the frame data in the frame data queue to be analyzed comprises the following components: frame data transmitted by a transmitting device; reading at least one complete frame from the combined frame data according to a preset starting mark and an ending mark, and determining that frame data reading is finished, wherein the complete frame has a preset length; and if the incomplete frames exist in the combined frame data after the frame data are read, adding the incomplete frames to the frame data queue to be analyzed. In the embodiment of the application, frame breaking processing is carried out on the combined frame data through a preset starting mark and an ending mark to obtain complete frame data; and adding the processed incomplete frame to a frame data queue to be analyzed, so that the incomplete frame and the new frame data can be combined after the new frame data is acquired, and then the complete frame data is acquired, thereby improving the utilization rate of the data and the reading efficiency.
Optionally, reading at least one complete frame from the combined frame data according to a preset start flag and an end flag, including:
and taking the combined frame data as initial data to be processed.
Wherein the frame data may be combined in a time sequence. For example: the incomplete frame obtained after the last processing may be arranged in front of the frame data, and the frame data obtained this time may be arranged after the incomplete frame obtained after the last processing.
A. And determining whether the data to be processed contains a complete frame according to whether the data to be processed contains a preset starting mark and an ending mark.
B. If yes, taking the data between the start mark and the end mark in the data to be processed as the contained complete frame, adding the contained complete frame into a complete frame queue, and deleting the contained complete frame from the data to be processed to obtain new data to be processed.
In the embodiment of the application, when the data to be processed contains a preset start mark and an end mark, the data to be processed is determined to contain a complete frame. In one implementation, when the data to be processed includes a complete frame, the data between the start flag and the end flag is stored as the complete frame in the complete frame queue. In another implementation, when the data to be processed includes a complete frame, the start flag, the end flag, and the data between the two flags may also be stored in a complete frame queue.
In addition, in order to ensure that the processing flow continues to be executed, the acquired complete frame can be deleted from the data to be processed, and new data to be processed can be acquired.
C. If not, determining whether the frame data reading is completed according to the length of the data to be processed.
Optionally, in the embodiment of the present application, if the length of the data to be processed is smaller than the length of the complete frame, it is determined that the reading of the frame data is completed. And if the length of the data to be processed is greater than or equal to the length of the complete frame, determining that the data of the complete frame is read.
D. If it is determined that the frame data reading is completed, ending.
E. And if the frame data is not completely read and the data to be processed does not contain the end mark, deleting the first start mark in the data to be processed to obtain new data to be processed.
And (3) circularly executing the steps A-E until the length of the data to be processed is 0.
In addition, when the frame data is not completely read and the data to be processed does not include the end mark, the first start mark in the data to be processed may be deleted in order to update the data to be processed. And performing loop execution on the steps A-E until the length of the data to be processed is 0.
Fig. 3 is a flowchart of a frame data processing method according to another embodiment of the present application, as shown in fig. 3, determining whether the data to be processed includes a complete frame according to whether the data to be processed includes a preset start flag and an end flag, including:
s301, judging whether the data to be processed contains a start mark.
S302, if so, determining whether the data to be processed contains a complete frame according to the length of the data to be processed and the end mark.
Optionally, in the embodiment of the present application, when the data to be processed includes the start flag, whether the data to be processed includes the complete frame may be determined continuously by the length of the data to be processed and the end flag. And when the data to be processed does not contain the initial mark, indicating that the current data to be processed is dirty data and does not contain useful data information, deleting the data to be processed.
Optionally, determining whether the data to be processed includes a complete frame according to the length of the data to be processed and the end flag includes:
if the length of the data to be processed is greater than or equal to the preset length and the data to be processed contains an end mark, determining that the data to be processed contains a complete frame.
It should be noted that, in the embodiment of the present application, if the data to be processed satisfies that the data length is greater than or equal to the preset length, and the data to be processed includes the end flag, it is determined that the data to be processed includes the complete frame.
When the length of the data to be processed is smaller than the preset length and the data to be processed does not contain the end mark, the data to be processed can be added into the frame data queue to be analyzed.
In order to clear dirty data in the data to be processed, the accuracy of the acquired complete frame data is ensured. In the embodiment of the application, dirty data in the data to be processed can be deleted before the complete frame data is determined.
Optionally, before determining whether the data to be processed contains the complete frame according to the length of the data to be processed and the end mark, the method further includes:
the data before the start flag is deleted from the data to be processed.
Optionally, in the embodiment of the present application, when a string of data exists before the start flag of the data to be processed, the data is dirty, and the data before the start flag is deleted to obtain new data to be processed.
Fig. 4 is a flowchart of a frame data processing method according to another embodiment of the present application, as shown in fig. 4, after adding an incomplete frame to a frame data queue to be analyzed, further including:
s401, receiving frame data sent by a sending device.
S402, combining the frame data sent by the sending equipment with the incomplete frame to obtain a new frame data queue to be analyzed.
In one implementation, after the incomplete frame is added to the frame data queue to be analyzed and the frame data sent by the sending device is received, specifically, after a new round of frame data is received, the frame data sent by the sending device may be combined with the incomplete frame to obtain a new frame data queue to be analyzed.
When the concentrators communicate with the server, an independent frame data queue to be analyzed of each concentrator is preset on the server. The data of each concentrator can be correspondingly stored in the frame data queue to be analyzed according to the concentrator address corresponding to the frame data queue to be analyzed.
Optionally, combining frame data sent by the sending device with an incomplete frame to obtain a new frame data queue to be analyzed, including:
and splicing the frame data sent by the sending equipment to the tail end of the incomplete frame to obtain a new frame data queue to be analyzed.
The combination of frame data and non-complete frames sent by the sending device may be accomplished by way of data stitching. Alternatively, the incomplete frame may be placed before the data queue, and after the frame data sent by the sending device is placed in the data queue, the combined data is finally used as a new frame data queue to be analyzed.
In order to clearly illustrate the frame data processing method according to an embodiment of the present application, fig. 5 is a flowchart of the whole frame data processing method according to another embodiment of the present application, which specifically includes the following steps:
s501, combining the frame data in the frame data queue to be analyzed to obtain combined frame data, and emptying the frame data queue to be analyzed.
S502, taking the combined frame data as initial data to be processed.
Step S501 is the same as the processing manner of step S201, and step S502 is already described in the above embodiment, which is not repeated in the embodiments of the present application.
S503, judging whether the data to be processed contains a start mark.
S504, if yes, deleting the data before the start mark from the data to be processed.
Step S503 is the same as the processing of step S301 in the above embodiment, and the specific implementation refers to step S301. When the data to be processed contains the initial mark, deleting the data before the initial mark from the data to be processed, and when the data to be processed does not contain the initial mark, directly deleting the data to be processed and ending.
S505, determining whether the data to be processed contains a complete frame according to the length of the data to be processed and the end mark.
S506, if the length of the data to be processed is greater than or equal to the preset length, and the data to be processed contains an end mark, determining that the data to be processed contains a complete frame.
In the embodiment of the application, if the length of the data to be processed is greater than or equal to the preset length and the data to be processed does not contain the end mark, deleting the first start mark in the data to be processed to obtain new data to be processed.
S507, taking the data between the start mark and the end mark in the data to be processed as the contained complete frame, adding the contained complete frame into a complete frame queue, and deleting the contained complete frame from the data to be processed to obtain new data to be processed.
S508, determining whether frame data reading is completed according to the length of the data to be processed.
S509, if the length of the data to be processed is 0, ending.
S510, if the length of the data to be processed is not 0, the process returns to step S503.
In the embodiment of the application, whether the reading of the frame data is completed can be judged according to the length of the data to be processed. Specifically, if the length of the data to be processed is 0, it indicates that the reading of the frame data is completed, and if the length of the data to be processed is not 0, it indicates that the reading of the frame data is not completed, and the process goes back to step S503 and completes the next cycle.
The following describes a device, a storage medium, etc. corresponding to the frame data processing method provided by the present application, and specific implementation processes and technical effects thereof are referred to above, and are not described in detail below.
Fig. 6 is a schematic diagram of a frame data processing apparatus according to an embodiment of the present application, as shown in fig. 6, the apparatus may include: a merging unit 601, a reading unit 602, an adding unit 603;
the merging unit 601 is configured to merge frame data in a frame data queue to be analyzed to obtain merged frame data, and empty the frame data queue to be analyzed, where the frame data in the frame data queue to be analyzed includes: frame data transmitted by a transmitting device;
a reading unit 602, configured to read at least one complete frame from the combined frame data according to a preset start flag and an end flag, and determine that the frame data is read, where the complete frame has a preset length;
and the adding unit 603 is configured to, if it is determined that the incomplete frame exists in the frame data after the frame data is read, add the incomplete frame to the frame data queue to be analyzed.
Optionally, a reading unit 602, configured to take the combined frame data as initial data to be processed;
A. determining whether the data to be processed contains a complete frame according to whether the data to be processed contains a preset starting mark and an ending mark;
B. if yes, taking the data between the start mark and the end mark in the data to be processed as the contained complete frame, adding the contained complete frame into a complete frame queue, and deleting the contained complete frame from the data to be processed to obtain new data to be processed;
C. if not, determining whether frame data reading is completed according to the length of the data to be processed;
D. if the frame data reading is determined to be completed, ending;
E. if the frame data is not completely read and the data to be processed does not contain the end mark, deleting the first start mark in the data to be processed to obtain new data to be processed;
and (3) circularly executing the steps A-E until the length of the data to be processed is 0.
Optionally, a reading unit 602, configured to determine whether the data to be processed includes a start flag;
if yes, determining whether the data to be processed contains a complete frame according to the length of the data to be processed and the end mark.
Optionally, the reading unit 602 is configured to determine that the data to be processed includes a complete frame if the length of the data to be processed is greater than or equal to a preset length and the data to be processed includes an end flag.
Fig. 7 is a schematic diagram of a frame data processing apparatus according to another embodiment of the present application, as shown in fig. 7, where the apparatus further includes: a deletion unit 604;
a deleting unit 604, configured to delete the data before the start flag from the data to be processed.
Fig. 8 is a schematic diagram of a frame data processing apparatus according to another embodiment of the present application, as shown in fig. 8, where the apparatus further includes: a receiving unit 605;
a receiving unit 605 for receiving frame data transmitted by the transmitting apparatus;
and the merging unit 601 is configured to merge the frame data sent by the sending device with the incomplete frame to obtain a new frame data queue to be analyzed.
Optionally, the merging unit 601 is configured to splice frame data sent by the sending device to the end of the incomplete frame, so as to obtain a new frame data queue to be analyzed.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application, including: processor 710, storage medium 720 and bus 730, storage medium 720 storing machine-readable instructions executable by processor 710, processor 710 executing machine-readable instructions to perform steps of the above-described method embodiments when the electronic device is operating, processor 710 communicating with storage medium 720 via bus 730. The specific implementation manner and the technical effect are similar, and are not repeated here.
An embodiment of the present application provides a storage medium having stored thereon a computer program which, when executed by a processor, performs the above-described method.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown 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 may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in hardware plus software functional units.
The integrated units implemented in the form of software functional units described above may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (english: processor) to perform some of the steps of the methods according to the embodiments of the application. And the aforementioned storage medium includes: u disk, mobile hard disk, read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.
The foregoing is merely illustrative of embodiments of the present application, and the present application is not limited thereto, and any changes or substitutions can be easily made by those skilled in the art within the technical scope of the present application, and the present application is intended to be covered by the present application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (6)

1. A frame data processing method, comprising:
combining frame data in a frame data queue to be analyzed to obtain combined frame data, and emptying the frame data queue to be analyzed;
taking the combined frame data as initial data to be processed;
the following steps A-H are performed:
a: judging whether the data to be processed contains a start mark or not;
b: if yes, deleting the data before the start mark from the data to be processed; if not, ending;
c: determining whether the data to be processed contains a complete frame or not according to the length of the data to be processed and an end mark;
d: if the length of the data to be processed is greater than or equal to the preset length and the data to be processed contains the end mark, determining that the data to be processed contains a complete frame; if not, ending;
e: taking the data between the start mark and the end mark in the data to be processed, the start mark and the end mark as complete frames, adding the complete frames into a complete frame queue, and deleting the complete frames from the data to be processed to obtain new data to be processed;
f: determining whether frame data reading is completed or not according to the length of the data to be processed;
g: if the length of the data to be processed is not 0, returning to the step A;
h: if the length of the data to be processed is 0, ending;
and if the incomplete frames exist after the execution of the steps A-H is finished, adding the incomplete frames to the frame data queue to be analyzed.
2. The method of claim 1, wherein after the adding the incomplete frame to the frame data queue to be analyzed, the method further comprises:
receiving frame data sent by a sending device;
and combining the frame data sent by the sending equipment with the incomplete frame to obtain a new frame data queue to be analyzed.
3. The method according to claim 2, wherein the merging the frame data sent by the sending device with the incomplete frame to obtain a new frame data queue to be analyzed includes:
and splicing the frame data sent by the sending equipment to the tail end of the incomplete frame to obtain a new frame data queue to be analyzed.
4. A frame data processing apparatus, comprising: the device comprises a merging unit, a reading unit and an adding unit;
the merging unit is used for merging the frame data in the frame data queue to be analyzed to obtain merged frame data, and emptying the frame data queue to be analyzed;
the reading unit is used for taking the combined frame data as initial data to be processed;
the reading unit is further configured to perform the following steps a-H:
a: judging whether the data to be processed contains a start mark or not;
b: if yes, deleting the data before the start mark from the data to be processed; if not, ending;
c: determining whether the data to be processed contains a complete frame or not according to the length of the data to be processed and an end mark;
d: if the length of the data to be processed is greater than or equal to the preset length and the data to be processed contains the end mark, determining that the data to be processed contains a complete frame; if not, ending;
e: taking the data between the start mark and the end mark in the data to be processed, the start mark and the end mark as complete frames, adding the complete frames into a complete frame queue, and deleting the complete frames from the data to be processed to obtain new data to be processed;
f: determining whether frame data reading is completed or not according to the length of the data to be processed;
g: if the length of the data to be processed is not 0, returning to the step A;
h: if the length of the data to be processed is 0, ending;
and the adding unit is used for adding the incomplete frame to the frame data queue to be analyzed if the incomplete frame exists after the execution of the steps A-H is finished.
5. An electronic device, comprising: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating over the bus when the electronic device is operating, the processor executing the machine-readable instructions to perform the steps of the method of any one of claims 1-3.
6. A storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method according to any of claims 1-3.
CN202110168008.9A 2021-02-05 2021-02-05 Frame data processing method and device, electronic equipment and storage medium Active CN112995066B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110168008.9A CN112995066B (en) 2021-02-05 2021-02-05 Frame data processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110168008.9A CN112995066B (en) 2021-02-05 2021-02-05 Frame data processing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112995066A CN112995066A (en) 2021-06-18
CN112995066B true CN112995066B (en) 2023-10-24

Family

ID=76348860

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110168008.9A Active CN112995066B (en) 2021-02-05 2021-02-05 Frame data processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112995066B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1798997A1 (en) * 2005-12-19 2007-06-20 Huawei Technologies Co., Ltd. Method, apparatus and system for implementing luUP/NBUP procedure control
CN104410613A (en) * 2014-11-20 2015-03-11 广西大学 A method and device for processing transmitting control protocol data adhering
CN105760134A (en) * 2016-02-03 2016-07-13 四川九洲电器集团有限责任公司 Data processing method and electronic equipment
CN105991223A (en) * 2015-02-13 2016-10-05 Tcl集团股份有限公司 Method and system for preventing packet splicing in TCP network data transmission
CN107040549A (en) * 2017-06-08 2017-08-11 山大鲁能信息科技有限公司 A kind of TCP packet splicings processing method, server and system
WO2017166095A1 (en) * 2016-03-30 2017-10-05 李昕光 Server front-end method
CN107948094A (en) * 2017-10-20 2018-04-20 西安电子科技大学 A kind of high speed data frame Lothrus apterus is joined the team the device and method of processing
WO2018086683A1 (en) * 2016-11-09 2018-05-17 Renesas Electronics Corporation Communications network controller module
CN110311746A (en) * 2019-06-19 2019-10-08 北京恒光信息技术股份有限公司 Low-order virtual concatenation alignment schemes and device
CN111245742A (en) * 2019-12-31 2020-06-05 宁波舜宇智能科技有限公司 Data buffering method and device, computer and readable storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1798997A1 (en) * 2005-12-19 2007-06-20 Huawei Technologies Co., Ltd. Method, apparatus and system for implementing luUP/NBUP procedure control
CN104410613A (en) * 2014-11-20 2015-03-11 广西大学 A method and device for processing transmitting control protocol data adhering
CN105991223A (en) * 2015-02-13 2016-10-05 Tcl集团股份有限公司 Method and system for preventing packet splicing in TCP network data transmission
CN105760134A (en) * 2016-02-03 2016-07-13 四川九洲电器集团有限责任公司 Data processing method and electronic equipment
WO2017166095A1 (en) * 2016-03-30 2017-10-05 李昕光 Server front-end method
WO2018086683A1 (en) * 2016-11-09 2018-05-17 Renesas Electronics Corporation Communications network controller module
CN107040549A (en) * 2017-06-08 2017-08-11 山大鲁能信息科技有限公司 A kind of TCP packet splicings processing method, server and system
CN107948094A (en) * 2017-10-20 2018-04-20 西安电子科技大学 A kind of high speed data frame Lothrus apterus is joined the team the device and method of processing
CN110311746A (en) * 2019-06-19 2019-10-08 北京恒光信息技术股份有限公司 Low-order virtual concatenation alignment schemes and device
CN111245742A (en) * 2019-12-31 2020-06-05 宁波舜宇智能科技有限公司 Data buffering method and device, computer and readable storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
一种从记录仪文件中提取HDLC数据帧的方法;王匀;;信息与电脑(理论版)(03);全文 *
处理整帧数据的FIFO的巧妙控制设计;房海东, 潘长勇, 杨知行;电讯技术(04);全文 *

Also Published As

Publication number Publication date
CN112995066A (en) 2021-06-18

Similar Documents

Publication Publication Date Title
CN110321387B (en) Data synchronization method, equipment and terminal equipment
CN104461903B (en) The method and apparatus of test client based on browser
US9104917B2 (en) Metering information collection
CN103914439A (en) Method, device and system for online document edition
CN113987074A (en) Distributed service full-link monitoring method and device, electronic equipment and storage medium
US20180329921A1 (en) Method and apparatus for storing time series data
CN104283926A (en) Data synchronization method, device and server
CN109241780B (en) Method, device and equipment for detecting hidden information of image
CN109672722B (en) Data deployment method and device, computer storage medium and electronic equipment
CN102685018A (en) Method and system for processing network instant messaging message and instant massaging equipment
CN109634764A (en) Work-flow control method, apparatus, equipment, storage medium and system
CN111026769A (en) Working method of dual-core front-end system and related equipment thereof
CN111914057A (en) Method and device for detecting and filtering sensitive words of customer service system
CN110162448A (en) The method and apparatus of log collection
CN110609967B (en) List generation method and device and storage medium
CN113591580B (en) Image annotation method and device, electronic equipment and storage medium
CN109144992A (en) A kind of method and apparatus of data storage
CN112995066B (en) Frame data processing method and device, electronic equipment and storage medium
CN106844423A (en) A kind of method and device of Data Detection
CN106250501A (en) Report processing method and reporting system
CN112433757A (en) Method and device for determining interface calling relationship
CN110534136A (en) The method and apparatus of recording
CN110019131A (en) A kind of method and apparatus of discs business
CN103530370B (en) Method and system for visualization deduction based on electronic map
CN115470189A (en) Data query method and device and readable storage medium

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
GR01 Patent grant
GR01 Patent grant