CN112637355B - Multi-concurrency single-channel based wireless data processing method, device, equipment and medium - Google Patents

Multi-concurrency single-channel based wireless data processing method, device, equipment and medium Download PDF

Info

Publication number
CN112637355B
CN112637355B CN202011586320.1A CN202011586320A CN112637355B CN 112637355 B CN112637355 B CN 112637355B CN 202011586320 A CN202011586320 A CN 202011586320A CN 112637355 B CN112637355 B CN 112637355B
Authority
CN
China
Prior art keywords
data
tag
preset
wireless
length
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
CN202011586320.1A
Other languages
Chinese (zh)
Other versions
CN112637355A (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 CN202011586320.1A priority Critical patent/CN112637355B/en
Publication of CN112637355A publication Critical patent/CN112637355A/en
Application granted granted Critical
Publication of CN112637355B publication Critical patent/CN112637355B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • GPHYSICS
    • G08SIGNALLING
    • G08CTRANSMISSION SYSTEMS FOR MEASURED VALUES, CONTROL OR SIMILAR SIGNALS
    • G08C17/00Arrangements for transmitting signals characterised by the use of a wireless electrical link
    • G08C17/02Arrangements for transmitting signals characterised by the use of a wireless electrical link using a radio link

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Arrangements For Transmission Of Measured Signals (AREA)

Abstract

The application provides a wireless data processing method, device, equipment and medium based on multiple concurrent single channels, and relates to the technical field of data meter reading. The method comprises the following steps: storing wireless data sent by an external data source into a preset data buffer pool, wherein the external data source comprises: a plurality of wireless smart meters; receiving buffer data from a data buffer pool by adopting a data receiving thread started in advance; and acquiring the data between the start tag and the end tag from the buffer data as effective data according to the preset start tag and the preset end tag. The accuracy of receiving effective data of the wireless meter reading equipment is improved through the method and the device.

Description

Multi-concurrency single-channel based wireless data processing method, device, equipment and medium
Technical Field
The invention relates to the technical field of data meter reading, in particular to a multi-concurrency single-channel wireless data processing method, device, equipment and medium.
Background
At present, more and more wireless meter reading devices and wireless intelligent meters based on a wireless communication technology are used, and it is very important how to ensure that the wireless meter reading devices can correctly receive and process data when a plurality of wireless intelligent meters send data to the wireless meter reading devices at the same time.
The existing wireless meter reading equipment receives the wireless intelligent meter data by adopting a delay processing method to process the data, namely, the data received in the specified delay time is used as one piece of effective data, the effective data is thrown to a subordinate service for processing, and the data outside the delay time is used as the next piece of effective data.
By adopting the time delay method, the wireless meter reading equipment may not receive the complete data frame in the time delay time, and partial data frames may be received in the next time delay time, so that the data is incomplete, and the lower-level service cannot process the data correctly.
Disclosure of Invention
The invention aims to provide a method, a device, equipment and a medium for processing wireless data based on multiple concurrent single channels so as to improve the accuracy of effective data received by wireless meter reading equipment.
In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
in a first aspect, an embodiment of the present application provides a method for processing wireless data based on multiple concurrent single channels, including:
storing wireless data sent by an external data source into a preset data buffer pool, wherein the external data source comprises: a plurality of wireless smart meters;
receiving buffer data from the data buffer pool by adopting a data receiving thread started in advance;
and acquiring the data between the start tag and the end tag from the buffer data as effective data according to the preset start tag and the preset end tag.
Optionally, the obtaining, according to a preset start tag and a preset end tag, data between the start tag and the end tag from the buffered data is valid data, including:
searching the starting tag in the buffer data;
intercepting data of a preset total length from the beginning of the beginning tag, wherein the preset total length is the sum of the length of the beginning tag, the length of the ending tag and the preset effective data length;
judging whether the last data in the intercepted data is the end tag or not;
and if the last data is the end tag, determining the data between the start tag and the end tag in the intercepted data as the valid data.
Optionally, before the capturing the data of the preset total length from the position of the start tag, the method further includes:
judging whether the data length behind the start tag in the buffer data reaches a preset data length, wherein the preset data length is the sum of the length of the end tag and the effective data length;
and if the preset data length is reached, starting from the starting tag, intercepting the data of the preset total length backwards.
Optionally, the method further comprises:
and if the preset data length is not reached, continuing to adopt the data receiving thread to receive the buffered data from the data buffer pool.
Optionally, the method further comprises:
and deleting invalid data before the start tag in the buffer data.
Optionally, the method further comprises:
and notifying the data buffer pool to delete the effective data.
Optionally, the method further comprises:
and calling a preset data distribution function, and transmitting the effective data to a service module for service processing.
In a second aspect, embodiments of the present application further provide a multi-concurrency single-channel wireless data processing apparatus, the apparatus including:
the data buffer module is used for storing wireless data sent by an external data source into a preset data buffer pool, and the external data source comprises: a plurality of wireless smart meters;
the data receiving module is used for receiving the buffer data from the data buffer pool by adopting a data receiving thread started in advance;
the data acquisition module is used for acquiring the data between the starting tag and the ending tag from the buffer data as effective data according to the preset starting tag and the preset ending tag.
Optionally, the data acquisition module includes:
a searching unit, configured to search the start tag in the buffered data;
a first intercepting unit, configured to intercept data of a preset total length from the beginning of the start tag, where the preset total length is a sum of the length of the start tag, the length of the end tag, and a preset valid data length;
the first judging unit is used for judging whether the last data in the intercepted data is the end tag or not;
and the determining unit is used for determining the data between the starting tag and the ending tag in the intercepted data as the valid data if the last data is the ending tag.
Optionally, before the first intercepting unit, the apparatus further includes:
a second judging unit, configured to judge whether a data length behind the start tag in the buffered data reaches a preset data length, where the preset data length is a sum of a length of the end tag and the valid data length;
and the first intercepting unit is used for intercepting the data with the preset total length from the starting tag backwards if the preset data length is reached.
Optionally, the apparatus further includes:
and the continuous receiving module is used for continuously adopting the data receiving thread to receive the buffered data from the data buffer pool if the preset data length is not reached.
Optionally, the apparatus further includes:
and the first deleting module is used for deleting invalid data before the start tag in the buffer data.
Optionally, the apparatus further includes:
and the second deleting module is used for notifying the data buffer pool to delete the effective data.
Optionally, the apparatus further includes:
and the data distribution module is used for calling a preset data distribution function and transmitting the effective data to the service module for service processing.
In a third aspect, embodiments of the present application further provide a wireless meter reading device, including: the system comprises a processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, when the wireless meter reading device is running, the processor and the storage medium are communicated through the bus, and the processor executes the program instructions to execute the steps of the multi-concurrency single-channel wireless data processing method.
In a fourth aspect, embodiments of the present application further provide a storage medium having a computer program stored thereon, which when executed by a processor performs the steps of any of the multiple concurrent single channel wireless data processing methods described above.
The beneficial effects of this application are:
according to the multi-concurrency single-channel wireless data processing method, device, equipment and medium, wireless data sent by an external data source are stored in the data buffer pool, buffer data in the data buffer pool are received through a data receiving thread, and the data between the start tag and the end tag are obtained as effective data by searching the start tag and the end tag in the buffer data. According to the scheme, the data buffer pool in the wireless meter reading equipment keeps a state of continuously receiving data, the data receiving thread continuously processes the buffered data in the data buffer pool, valid data is confirmed through searching a start tag and an end tag, the received valid data is guaranteed to be received completely, the complete data is sent to the service module for processing, the problem that the wireless meter reading equipment forwards the data to a lower-level service without receiving the complete data sent by the wireless intelligent meter is avoided, the lower-level service module fails to analyze the data, the wireless meter reading equipment is ensured to read and store the data of the wireless intelligent meter based on the analyzed data, and accordingly the resource service condition corresponding to the wireless intelligent meter is accurately read and stored.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, 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 invention 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 schematic flow chart of a first multi-concurrency single-channel wireless data processing method according to an embodiment of the present application;
fig. 2 is a flow chart of a second method for processing wireless data based on multiple concurrent single channels according to an embodiment of the present application;
fig. 3 is a flow chart of a third method for processing wireless data based on multiple concurrent single channels according to an embodiment of the present application;
fig. 4 is a flow chart of a fourth method for processing wireless data based on multiple concurrent single channels according to an embodiment of the present application;
fig. 5 is an interaction schematic diagram of a data processing method without multiple concurrent single channel lines according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a wireless data processing device based on multiple concurrent single channels according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a wireless meter reading 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 invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. The components of the embodiments of the present invention 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 invention, as presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
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.
In the description of the present invention, the terms "first," "second," "third," and the like are used merely to distinguish between descriptions and are not to be construed as indicating or implying relative importance.
The wireless data processing method based on multiple concurrent single channels can be performed on the wireless meter reading equipment with the wireless data processing function, an external data source is a wireless intelligent meter, the wireless meter reading equipment is in wireless communication connection with the wireless intelligent meter, so that wireless data sent by the wireless intelligent meter can be received and processed, and the sent wireless data are data needing service processing. The wireless meter reading equipment is provided with a wireless data processing system, a data processing Thread, a data Buffer pool Buffer and a data operator Handler can be established through the wireless data processing system, the data Buffer pool Buffer, the data processing Thread and the data operator Handler are all data processing modules in the wireless meter reading equipment, the data Buffer pool Buffer is a Buffer zone of wireless data, the data processing Thread is used for receiving the wireless data, and the data operator Handler is used for distributing the wireless data to a lower-level service module.
It should be noted that, the wireless smart meter according to the embodiments of the present application may be a wireless gas meter, a wireless electric meter, a wireless water meter, or other smart meters capable of performing wireless data transmission.
If the wireless intelligent meter is a wireless gas meter, the wireless meter reading equipment receives and processes the gas data, if the wireless intelligent meter is a wireless electric meter, the wireless meter reading equipment receives and processes the electricity data, and if the wireless intelligent meter is a wireless water meter, the wireless meter reading equipment receives and processes the water data.
Fig. 1 is a schematic flow chart of a first multi-concurrency single-channel wireless data processing method according to an embodiment of the present application; as shown in fig. 1, the method includes:
s100: and storing the wireless data sent by the external data source into a preset data buffer pool.
Specifically, the external data sources include: a plurality of wireless smartmeters. Before wireless data processing, the wireless data processing system creates a data receiving Thread and a data Buffer pool Buffer in advance, after the wireless meter reading equipment is in communication connection with a plurality of wireless intelligent meters, the wireless intelligent meters sequentially send wireless data to be reported to the wireless meter reading equipment, the wireless data comprises a START TAG (START_TAG), an END TAG (END_TAG) and effective data between the START TAG and the END TAG, the wireless data is sent according to a data receiving and sending format agreed by a preset data transmission Protocol (Protocol), and the wireless data processing system stores the received wireless data in the data Buffer pool Buffer according to time sequence. For example, the data transceiving format agreed by the preset data transmission protocol may be a format of a plurality of hexadecimal data frames.
S200: the buffered data from the data buffer pool is received using a pre-started data receiving thread.
Specifically, whether a pre-created data receiving Thread is started or not is judged, when the data receiving Thread is in an operating state, the data receiving Thread enters a data Buffer pool Buffer, whether Buffer data exist in the data Buffer pool Buffer or not is judged, if no Buffer data exist in the data Buffer pool Buffer, the data Buffer pool Buffer continuously waits for receiving wireless data, and a wireless data processing system continuously judges whether Buffer data exist in the data Buffer pool Buffer or not.
When the Buffer data in the data Buffer pool is detected, the Buffer data is sent to the data receiving Thread.
S300: and acquiring the data between the start tag and the end tag from the buffer data as effective data according to the preset start tag and the preset end tag.
Specifically, the preset starting tag is a starting tag sent by the wireless data sending device before sending the wireless data, the preset ending tag is an ending tag sent by the wireless data sending device after sending the wireless data, the data receiving Thread searches whether the received buffer data has the starting tag and the ending tag, if the starting tag and the ending tag are detected, it is indicated that the wireless meter reading device has received the complete wireless data sent by the wireless data sending device, the data between the starting tag and the ending tag is intercepted to be used as effective data, and the effective data is forwarded to the lower-level business processing.
In an alternative embodiment, the method further comprises:
and calling a preset data distribution function, and transmitting the effective data to a service module for service processing.
Specifically, the wireless data processing system creates a data operator Handler, the data operator Handler is java, the data operator Handler comprises a data operation Thread and a data distribution function, after the data receiving Thread acquires effective data, the data distribution function is called, the effective data is transmitted to a service module through the data distribution function Handler, the service module analyzes the effective data according to a data transmission protocol, and service processing is carried out according to the analyzed effective data. For example, if the wireless intelligent meter is a wireless gas meter, the gas usage amount, the gas residual amount and the gas cost can be calculated according to the analyzed effective gas data; if the wireless intelligent meter is a wireless ammeter, the electricity consumption, the residual electricity consumption and the electricity fee can be calculated according to the analyzed effective electricity data; if the wireless intelligent meter is a wireless water meter, the water consumption, the residual water consumption and the water cost can be calculated according to the analyzed effective water data.
According to the multi-concurrency single-channel wireless data processing method, wireless data sent by an external data source are stored in the data buffer pool, buffer data in the data buffer pool are received through the data receiving thread, and the data between the start tag and the end tag are obtained as effective data by searching the start tag and the end tag in the buffer data. According to the scheme, the data buffer pool in the wireless meter reading equipment keeps a state of continuously receiving data, the data receiving thread continuously processes the buffer data in the data buffer pool, valid data is confirmed through searching a start tag and an end tag, the integrity of the received valid data is guaranteed, the complete data is sent to a service module for processing, the problem that the wireless meter reading equipment does not receive the complete data sent by the wireless intelligent meter and forwards the data to a lower-level service is avoided, the failure of analyzing the data by the lower-level service module is caused, the wireless meter reading equipment is guaranteed to read and store the data of the wireless intelligent meter based on the analyzed data, and accordingly, for example, if the wireless intelligent meter is a wireless gas meter, the wireless meter reading equipment can accurately acquire and analyze the data of the wireless gas meter, and gas use data of a gas user and a gas company can be accurately read and stored, and gas use conditions are conveniently known.
On the basis of the foregoing embodiments, the embodiment of the present application further provides a method for processing wireless data based on multiple concurrent single channels, and fig. 2 is a schematic flow chart of a second method for processing wireless data based on multiple concurrent single channels, as shown in fig. 2, where the step S300 includes:
s301: the start tag in the buffered data is looked up.
Specifically, the data receiving Thread searches whether the received buffered data includes a start tag, if the start tag is not found, the data receiving Thread returns to S200 above, determines whether the data receiving Thread is started, and executes the subsequent steps under the condition that the data receiving Thread is started, and uses the data receiving Thread to receive the buffered data from the Buffer of the data Buffer pool.
S302: and intercepting the data of the preset total length from the beginning of the starting tag.
Specifically, the preset total length is the length of wireless data specified by the data transmission protocol, and when the wireless data transmitting device transmits the wireless data to the wireless meter reading device, the wireless data transmitting device also transmits the data of the preset total length to the wireless meter reading device. The wireless data comprises a start tag, an end tag and effective data between the start tag and the end tag, wherein the preset total length is the sum of the length of the start tag, the length of the end tag and the preset effective data length, and if the data receiving Thread searches the start tag, the data of the preset total length is intercepted backwards from the start of the start tag according to the preset total length.
S303: judging whether the last data in the intercepted data is an end tag.
Specifically, the data receiving Thread determines whether the last data in the intercepted data is an end tag, if the last data is not the end tag, the data receiving Thread returns to S200, determines whether the data receiving Thread is started, and executes the subsequent steps under the condition that the data receiving Thread is started, and the data receiving Thread is adopted to receive the buffered data from the Buffer of the data Buffer pool.
S304: and if the last data is the end tag, determining the data between the start tag and the end tag in the intercepted data as effective data.
Specifically, if the last data is the end tag, it indicates that the wireless meter reading device has received the complete wireless data sent by the wireless data sending device, the data between the start tag and the end tag is intercepted as effective data, a preset data distribution function can be called, and the effective data is transmitted to the service module for service processing.
According to the multi-concurrency single-channel wireless data processing method, the starting tag in the buffer data is searched, the data with the preset total length is intercepted backwards from the beginning of the starting tag, whether the last data in the intercepted data is an ending tag is judged, and if the last data is the ending tag, the data between the starting tag and the ending tag in the intercepted data are sent to the service module as effective data. By checking whether the wireless meter reading equipment receives complete wireless data or not, the success rate of analyzing the wireless data by the service module can be increased, failure in data analysis caused by incomplete wireless data sent to the service module is avoided, data analysis time is consumed, accordingly, the wireless meter reading equipment can be ensured to receive the wireless data sent by the wireless intelligent meter, and the success rate of data receiving is improved.
On the basis of any one of the foregoing embodiments, the embodiment of the present application further provides a method for processing wireless data based on multiple concurrent single channels, and fig. 3 is a schematic flow chart of a third method for processing wireless data based on multiple concurrent single channels, which is provided in the embodiment of the present application, as shown in fig. 3, and before S302, the method further includes:
s302a: and judging whether the data length behind the start tag in the buffer data reaches the preset data length.
Specifically, the preset data length is the sum of the length of the ending tag and the effective data length, when the wireless data sending device sends wireless data to the wireless meter reading device, the preset data length is also sent to the wireless meter reading device, and after the data receiving Thread searches the starting tag, the data receiving Thread judges whether the data length after the starting tag reaches the preset data length.
In an alternative embodiment, the method further comprises:
if the preset data length is not reached, the data receiving thread is continuously adopted to receive the buffer data from the data buffer pool.
Specifically, if the preset data length is not reached, the data receiving Thread returns to S200, determines whether the data receiving Thread is started, and executes the subsequent steps under the condition that the data receiving Thread is started, and the data receiving Thread is adopted to receive the buffered data from the Buffer of the data Buffer pool.
S302b: if the preset data length is reached, the data with the preset total length is intercepted from the beginning label.
Specifically, if the preset data length is reached, it indicates that the wireless meter reading device has received the complete wireless data sent by the wireless data sending device, then according to the preset total length, intercepting the data of the preset total length from the beginning of the beginning tag, and judging whether the last data in the intercepted data is the ending tag.
For example, the data transmission protocol specifies a preset total length of L. The length of the start tag is S, the length of the end tag is E, and the length of the valid data between the start tag and the end tag is C, then the preset total length l=s+e+c, and the preset data length is c+e.
According to the multi-concurrency single-channel-based wireless data processing method, after the starting tag in the buffered data is found, whether the data length after the starting tag reaches the preset data length or not is judged, namely, the sum of the length of the ending tag and the effective data length is judged, if the data length reaches the preset data length, the data with the preset total length is intercepted backwards from the starting tag, and if the data length does not reach the preset data length, the data receiving thread is continuously adopted to receive the buffered data from the data buffer pool. By the method, whether the wireless meter reading equipment receives complete wireless data can be checked, the success rate of wireless data analysis by the service module can be increased, failure in data analysis caused by incomplete wireless data sent to the service module is avoided, the data analysis time is consumed, the wireless meter reading equipment can be ensured to receive the wireless data sent by the wireless intelligent meter, and the success rate of data receiving is improved.
On the basis of any one of the above embodiments, an embodiment of the present application further provides a method for processing wireless data based on multiple concurrent single channels, where the method further includes: and deleting invalid data before the start tag in the buffer data.
Specifically, after the data receiving Thread searches for the start tag in the buffered data, it is determined that the data before the start tag is not valid data transmitted by the wireless data transmitting device, that is, invalid data, and the data Buffer pool Buffer is transmitted to the invalid data before the start tag of the data receiving Thread.
According to the multi-concurrency single-channel wireless data processing method, invalid data before labels are started in buffered data are deleted, interference of working frequencies among a plurality of wireless data sending devices is avoided, data sent by other wireless data sending devices are received when wireless data of one wireless data sending device are received by wireless meter reading devices, invalid data which does not belong to the wireless data sending devices are prevented from being transmitted to a service module for analysis, data analysis failure is caused, data analysis time is consumed, accordingly, the wireless meter reading devices can receive wireless data sent by a wireless intelligent meter, and data analysis success rate and analysis efficiency are improved.
On the basis of any one of the above embodiments, an embodiment of the present application further provides a method for processing wireless data based on multiple concurrent single channels, where the method further includes: and notifying the data buffer pool to delete the valid data.
Specifically, after the data receiving Thread acquires the effective data, the effective data in the data Buffer pool Buffer is deleted, so that the uniqueness of the data in the data Buffer pool Buffer is ensured, the repeated data transmission is avoided, and the workload of the data receiving Thread and the service module for repeatedly processing the data is reduced.
On the basis of any one of the above embodiments, an embodiment of the present application further provides a method for processing wireless data based on multiple concurrent single channels, where the method further includes: and carrying out data verification on the content of the effective data, and judging the correctness of the effective data.
In one possible example, the data verification of the content of the valid data is performed by: and judging whether the sum of the valid data is equal to the check data, wherein the sum of the valid data does not exceed the overflow value of FF. For example, if the sum of the valid data is 1D3, only D3 is determined when determining whether the sum of the valid data is equal to the check data, and the overflow value 1 of FF is not exceeded.
Specifically, if the data transmission protocol specifies that data verification is required on the effective data, the wireless data transmitting device further transmits verification data when transmitting the wireless data, the data receiving Thread judges whether the sum of the effective data is equal to the verification data after acquiring the effective data, and if the sum of the effective data is equal to the verification data, the content of the effective data is determined to be correct, and the effective data is transmitted to the service module for service processing.
In another possible example, the data verification of the content of the valid data is performed by: it is determined whether the sum of the start tag and the valid data is equal to the check data.
Specifically, if the sum of the start tag and the effective data is equal to the check data, determining that the content of the effective data is correct, and transmitting the effective data to a service module for service processing.
For example, the Buffer data received by the data receiving Thread from the data Buffer pool Buffer is: 68 10 01 00 31 12 13 10 00 04 04 17 A0 00 99 37 16, the start tag is 68, the end tag is 16, the check data is 37, and the valid data is a plurality of hexadecimal data frames, then it can be known through calculation that 68+10+01+00+31+12+13+10+00+04+04+17+a0+00+99=237, the sum of the start tag and the valid data is equal to the value of the check data after the overflow value is removed.
Whether or not the data is to be checked in combination with the start tag is determined by the data transmission protocol, and the method is not limited.
On the basis of any one of the foregoing embodiments, the embodiment of the present application further provides a multi-concurrency single-channel wireless data processing method, fig. 4 is a schematic flow chart of a fourth multi-concurrency single-channel wireless data processing method provided in the embodiment of the present application, and fig. 5 is an interactive schematic diagram of the multi-concurrency single-channel wireless data processing method provided in the embodiment of the present application, as shown in fig. 4 and fig. 5, where the method includes:
s00: a data receiving thread, a data buffer pool, and a data operator are created.
Specifically as in fig. 5 system creation Thread, buffer and Handler.
S10: and judging whether the data receiving thread is in a running state or not.
Specifically, as shown in fig. 5, the reception Thread is started, and the running flag is determined.
S20: and if the data receiving thread is in an operating state, obtaining the buffered data from the data buffer pool.
Specifically, as shown in fig. 5, the Buffer is entered to determine whether there is data in the Buffer, and the data is processed by the Thread.
S30: if yes, the buffer data is sent to a data receiving thread, a start tag in the buffer data is searched, if the start tag is searched, invalid data before the start tag in the buffer data is deleted, otherwise, the buffer data is continuously received, and the start tag is searched.
Specifically, as shown in fig. 5, the start_tag position is searched, the start_tag position exists, invalid data before the start_tag is deleted, the start_tag position does not exist, and the continuous loop is returned.
S40: and judging whether the data length behind the start tag in the buffer data reaches the preset data length.
In particular, as shown in fig. 5, it is determined whether the data length following the start_tag in the buffered data reaches the preset data length, and if the data length does not reach the preset data length, the loop is returned to continue.
S50: and intercepting the data of the preset total length from the beginning of the starting tag.
In particular, the data of the preset total length is intercepted from the start_tag backward in fig. 5.
S60: judging whether the last data in the intercepted data is an end tag.
Specifically, as shown in fig. 5, whether the last data in the intercepted data is end_tag is judged, if the end_tag is not intercepted, the continuous circulation is returned.
S70: and determining the data between the start tag and the end tag in the intercepted data as valid data.
S80: and carrying out data verification on the valid data.
In particular, in fig. 5, data between start_tag and end_tag in the intercepted data is determined as valid data, and data verification is performed.
S90: and calling a preset data distribution function, transmitting the effective data to a service module for service processing, and informing a data buffer pool to delete the effective data.
Specifically, as shown in fig. 5, the data is delivered to the Handler, the Handler calls a data distribution function to deliver the data to the service module, and the data returns to continue to circulate after being delivered to the Handler, so as to receive the next wireless data.
The specific implementation principle and technical effect of the wireless data processing and transmitting provided in the embodiment of the present application refer to the above embodiment, and are not described herein.
The embodiment of the application also provides a wireless data processing device based on multiple concurrent single channels, and fig. 6 is a schematic structural diagram of the wireless data processing device based on multiple concurrent single channels, as shown in fig. 6, where the device includes:
the data buffering module 100 is configured to store wireless data sent by an external data source into a preset data buffering pool, where the external data source includes: a plurality of wireless smart meters;
a data receiving module 200, configured to receive buffered data from the data buffer pool by using a data receiving thread started in advance;
the data obtaining module 300 is configured to obtain, from the buffered data, valid data that is data between the start tag and the end tag according to the preset start tag and the preset end tag.
In an alternative embodiment, the data acquisition module 300 includes:
the searching unit is used for searching the starting label in the buffer data;
the first interception unit is used for intercepting data of a preset total length from the beginning of the beginning tag backwards, wherein the preset total length is the sum of the length of the beginning tag, the length of the ending tag and the preset effective data length;
the first judging unit is used for judging whether the last data in the intercepted data is an end tag or not;
and the determining unit is used for determining the data between the start tag and the end tag in the intercepted data as effective data if the last data is the end tag.
In an alternative embodiment, before the first interception unit, the apparatus further comprises:
the second judging unit is used for judging whether the data length behind the start tag in the buffer data reaches the preset data length, wherein the preset data length is the sum of the length of the end tag and the data length;
and the first interception unit is used for intercepting the data with the preset total length from the start tag backwards if the preset data length is reached.
In an alternative embodiment, the apparatus further comprises:
and the continuous receiving module is used for continuously adopting the data receiving thread to receive the buffered data from the data buffer pool if the preset data length is not reached.
In an alternative embodiment, the apparatus further comprises:
and the first deleting module is used for deleting invalid data before the start tag in the buffer data.
In an alternative embodiment, the apparatus further comprises:
and the second deleting module is used for notifying the data buffer pool to delete the effective data.
In an alternative embodiment, the apparatus further comprises:
and the data distribution module is used for calling a preset data distribution function and transmitting the effective data to the service module for service processing.
The foregoing apparatus is used for executing the method provided in the foregoing embodiment, and its implementation principle and technical effects are similar, and are not described herein again.
The above modules may be one or more integrated circuits configured to implement the above methods, for example: one or more application specific integrated circuits (Application Specific Integrated Circuit, abbreviated as ASIC), or one or more microprocessors (digital singnal processor, abbreviated as DSP), or one or more field programmable gate arrays (Field Programmable Gate Array, abbreviated as FPGA), or the like. For another example, when a module above is implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a central processing unit (Central Processing Unit, CPU) or other processor that may invoke the program code. For another example, the modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 7 is a schematic structural diagram of a wireless meter reading device according to an embodiment of the present application, where the wireless meter reading device 400 includes:
the wireless meter reading device 400 comprises a processor 401, a storage medium 402 and a bus, wherein the storage medium 402 stores program instructions executable by the processor 401, when the wireless meter reading device 400 is operated, the processor 401 communicates with the storage medium 402 through the bus, and the processor 401 executes the program instructions to execute the steps of the wireless data processing method based on multiple concurrent single channels according to any embodiment.
Optionally, the present invention further provides a storage medium, on which a computer program is stored, which when being executed by a processor performs the steps of the multi-concurrency single-channel wireless data processing method according to any of the above embodiments.
In the several embodiments provided by the present invention, 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 invention 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 invention. 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 invention, and the present invention 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 invention, and the present invention is intended to be covered by the present invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (9)

1. The multi-concurrency single-channel wireless data processing method is characterized by comprising the following steps of:
storing wireless data sent by an external data source into a preset data buffer pool, wherein the external data source comprises: a plurality of wireless smart meters;
receiving buffer data from the data buffer pool by adopting a data receiving thread started in advance;
acquiring data between a start tag and an end tag from the buffer data as effective data according to a preset start tag and a preset end tag;
the obtaining, according to a preset start tag and a preset end tag, data between the start tag and the end tag from the buffered data as valid data includes:
searching the starting tag in the buffer data;
intercepting data of a preset total length from the beginning of the beginning tag, wherein the preset total length is the sum of the length of the beginning tag, the length of the ending tag and the preset effective data length, and the preset total length is the length of wireless data specified by a data transmission protocol;
judging whether the last data in the intercepted data is the end tag or not;
and if the last data is the end tag, determining the data between the start tag and the end tag in the intercepted data as the valid data.
2. The method of claim 1, wherein before the intercepting the data of the preset total length from the position of the start tag, the method further comprises:
judging whether the data length behind the start tag in the buffer data reaches a preset data length, wherein the preset data length is the sum of the length of the end tag and the effective data length;
and if the preset data length is reached, starting from the starting tag, intercepting the data of the preset total length backwards.
3. The method of claim 2, wherein the method further comprises:
and if the preset data length is not reached, continuing to adopt the data receiving thread to receive the buffered data from the data buffer pool.
4. The method of claim 1, wherein the method further comprises:
and deleting invalid data before the start tag in the buffer data.
5. The method of claim 1, wherein the method further comprises:
and notifying the data buffer pool to delete the effective data.
6. The method of any one of claims 1-5, wherein the method further comprises:
and calling a preset data distribution function, and transmitting the effective data to a service module for service processing.
7. A multi-concurrency single-channel wireless data processing apparatus, the apparatus comprising:
the data buffer module is used for storing wireless data sent by an external data source into a preset data buffer pool, and the external data source comprises: a plurality of wireless smart meters;
the data receiving module is used for receiving the buffer data from the data buffer pool by adopting a data receiving thread started in advance;
the data acquisition module is used for acquiring data between the starting tag and the ending tag from the buffer data as effective data according to a preset starting tag and a preset ending tag;
the data acquisition module comprises:
a searching unit, configured to search the start tag in the buffered data;
a first intercepting unit, configured to intercept data of a preset total length from the beginning of the start tag, where the preset total length is a sum of the length of the start tag, the length of the end tag, and a preset valid data length;
the first judging unit is used for judging whether the last data in the intercepted data is the end tag or not;
and the determining unit is used for determining the data between the starting tag and the ending tag in the intercepted data as the valid data if the last data is the ending tag.
8. A wireless meter reading device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, when the wireless meter reading device is running, the processor communicates with the storage medium through the bus, and the processor executes the program instructions to perform the steps of the multi-concurrency single-channel wireless data processing method according to any one of claims 1 to 6.
9. A storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the multi-concurrency single-channel wireless data processing method of any one of claims 1 to 6.
CN202011586320.1A 2020-12-25 2020-12-25 Multi-concurrency single-channel based wireless data processing method, device, equipment and medium Active CN112637355B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011586320.1A CN112637355B (en) 2020-12-25 2020-12-25 Multi-concurrency single-channel based wireless data processing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011586320.1A CN112637355B (en) 2020-12-25 2020-12-25 Multi-concurrency single-channel based wireless data processing method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN112637355A CN112637355A (en) 2021-04-09
CN112637355B true CN112637355B (en) 2023-05-23

Family

ID=75286001

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011586320.1A Active CN112637355B (en) 2020-12-25 2020-12-25 Multi-concurrency single-channel based wireless data processing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN112637355B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101719306A (en) * 2009-10-30 2010-06-02 深圳市科陆电子科技股份有限公司 Parallel electric quantity data acquisition method
CN105809942A (en) * 2016-03-17 2016-07-27 国家电网公司 Data processing method and device for electricity information collection system
CN107179942A (en) * 2017-05-16 2017-09-19 中国电子科技集团公司第四十研究所 A kind of real-time data analysis task distribution processing method based on multithreading
CN109918545A (en) * 2019-03-26 2019-06-21 珠海格力智能装备有限公司 Method and device for extracting sensor data
CN110113323A (en) * 2019-04-20 2019-08-09 深圳瀚星翔科技有限公司 A kind of communication means, electronic equipment and computer readable storage medium
CN111540190A (en) * 2020-07-07 2020-08-14 南方电网数字电网研究院有限公司 Data distribution method and device based on double-core intelligent electric meter and computer equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10902020B2 (en) * 2018-06-08 2021-01-26 International Business Machines Corporation Multiple cache processing of streaming data

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101719306A (en) * 2009-10-30 2010-06-02 深圳市科陆电子科技股份有限公司 Parallel electric quantity data acquisition method
CN105809942A (en) * 2016-03-17 2016-07-27 国家电网公司 Data processing method and device for electricity information collection system
CN107179942A (en) * 2017-05-16 2017-09-19 中国电子科技集团公司第四十研究所 A kind of real-time data analysis task distribution processing method based on multithreading
CN109918545A (en) * 2019-03-26 2019-06-21 珠海格力智能装备有限公司 Method and device for extracting sensor data
CN110113323A (en) * 2019-04-20 2019-08-09 深圳瀚星翔科技有限公司 A kind of communication means, electronic equipment and computer readable storage medium
CN111540190A (en) * 2020-07-07 2020-08-14 南方电网数字电网研究院有限公司 Data distribution method and device based on double-core intelligent electric meter and computer equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于多Agent的无线网络水表抄表系统应用研究;杨继东等;《测控技术》;20140131(第01期);104-108 *

Also Published As

Publication number Publication date
CN112637355A (en) 2021-04-09

Similar Documents

Publication Publication Date Title
CN110489391B (en) Data processing method and related equipment
CN108521353B (en) Processing method and device for positioning performance bottleneck and readable storage medium
CN109885496B (en) Test log management method and system
JP2008140162A (en) Debug information collection method
CN111818136A (en) Data processing method and device, electronic equipment and computer readable medium
CN105471968B (en) A kind of method for interchanging data, system and data platform server
CN110941553A (en) Code detection method, device, equipment and readable storage medium
CN110309065B (en) Concurrent execution method, device and equipment of test tasks and storage medium
CN109241722A (en) For obtaining method, electronic equipment and the computer-readable medium of information
CN112948224A (en) Data processing method, device, terminal and storage medium
CN109783284A (en) Information acquisition method, system and server, computer readable storage medium
CN113608969A (en) Service system operation monitoring system and method
CN110493250A (en) A kind of WEB front-end ARCGIS resource request processing method and processing device
CN112637355B (en) Multi-concurrency single-channel based wireless data processing method, device, equipment and medium
CN114153712A (en) Exception handling method, device, equipment and storage medium
CN103077080A (en) Method and device for acquiring parallel program performance data based on high performance platform
CN111431733B (en) Service alarm coverage information evaluation method and device
CN112749062A (en) Server program monitoring method and device, computer equipment and storage medium
CN107342917B (en) Method and apparatus for detecting network device performance
CN114553663B (en) Abnormality detection method, abnormality detection device, abnormality detection equipment and storage medium
CN114513334B (en) Risk management method and risk management device
CN112131070B (en) Calling relation tracking method, device, equipment and computer readable storage medium
CN115220984A (en) Business application monitoring method and device, electronic equipment and storage medium
CN110908886A (en) Data sending method and device, electronic equipment and storage medium
CN112988560A (en) Method and device for testing system robustness

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