Data processing method, device and equipment
By processing environmental data into grayscale images and compressing them into transmission messages, the problem of difficulty in data transmission of environmental monitoring equipment when network conditions are poor is solved, fast and stable data transmission and acquisition are achieved, and data transmission efficiency and reliability are improved. sex.
Patent Information
- Application Number
- CN202410958818.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-10-08
AI Technical Summary
When network conditions are poor or disconnected, it is difficult for environmental monitoring equipment to quickly transmit the collected environmental data, and it is difficult to obtain data at one time, resulting in long and unstable transmission times.
The environmental data is processed into grayscale images and compressed into transmission messages according to preset compression rules to achieve fast transmission from the device to the server. The server can obtain the target environment data at once in a short time.
Through grayscale image compression technology, rapid transmission and stable acquisition of environmental data are achieved, reducing the risk of manual intervention and equipment damage, and improving data transmission efficiency and reliability.
Smart Images

Figure CN118748690A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data processing method, device and equipment. Background Art
[0002] Environmental monitoring points are deployed in different environments to monitor environmental quality.
[0003] Specifically, environmental monitoring equipment is set up at each environmental monitoring point in the same environment. The environmental monitoring equipment is responsible for collecting environmental monitoring data and uploading it to the database through the network. When the environmental monitoring equipment is set up in a place with poor network conditions, or when encountering periodic network adjustments such as network maintenance, the data will not be reported for a long time. However, when the network is restored, or the environmental monitoring equipment is placed in a place with better network conditions, it takes a long time to obtain environmental monitoring data, and it is difficult to obtain it successfully in one go. Summary of the invention
[0004] In view of the above problems, the present application provides a data processing method, device and equipment to achieve the purpose of one-time rapid transmission of environmental data collected by the device. The specific scheme is as follows:
[0005] The first aspect of the present application provides a data processing method, which is applied to a device, comprising:
[0006] Receive an environmental data collection request initiated by the server, and determine target environmental data corresponding to the environmental data collection request;
[0007] Processing the target environment data into a grayscale image, and compressing the grayscale image into a transmission message according to a preset compression rule;
[0008] Send the transmission message to the server so that the server can parse the transmission message into the target environment data.
[0009] In a possible implementation, the environment data collection request includes a target device and environment data collection indication information, and determining the environment data corresponding to the environment data collection request includes:
[0010] A target device is selected from various devices at the device end, and target environmental data corresponding to the target device is determined according to the environmental data collection indication information; the target environmental data is environmental data collected at the same time interval.
[0011] In a possible implementation, the grayscale image is a grayscale matrix image; processing the target environment data into the grayscale image includes:
[0012] The target environment data is filled into a preset grayscale dictionary according to a preset corresponding rule to obtain a grayscale matrix image; the preset corresponding rule is determined according to the data characteristics of the target environment data.
[0013] In a possible implementation, compressing the grayscale image into a transmission message according to a preset compression rule includes:
[0014] The grayscale image is compressed and encoded to obtain a transmission message including key information; the key information includes a parsing rule of a correspondence between the grayscale image and the target environmental data defined in character form and the total number of environmental data items.
[0015] A second aspect of the present application provides a data processing device, applied to a device, comprising:
[0016] Receiving unit, processing unit and sending unit;
[0017] A receiving unit, configured to receive an environmental data collection request initiated by a server, and determine target environmental data corresponding to the environmental data collection request;
[0018] A processing unit, used to process the target environment data into a grayscale image, and compress the grayscale image into a transmission message according to a preset compression rule;
[0019] The sending unit is used to send the transmission message to the server so that the server can parse the transmission message into target environment data.
[0020] A third aspect of the present application provides a data processing device, applied to a device end, comprising at least one processor and a memory connected to the processor, wherein:
[0021] The memory is used to store computer programs;
[0022] The processor is used to execute a computer program so that the data processing device can implement the data processing method described in the first aspect or any implementation of the first aspect. A fourth aspect of the present application provides a data processing method, which is applied to a server, comprising:
[0023] The server detects the network connection status between it and the device;
[0024] When the network connection is normal, the environmental data collected and sent by each device on the receiving device side;
[0025] When the duration of the abnormal network connection exceeds the preset time and the current network connection is normal, an environment data collection request is initiated to the device end, and the environment data collection request is used to instruct the device end to determine the target environment data from the collected environment data, and send it to the server end after performing preset processing; the preset processing includes: processing the target environment data into a grayscale image, and compressing it into a transmission message according to a preset compression rule;
[0026] Receive and parse the transmission message sent by the device to obtain the target environment data.
[0027] In a possible implementation, the transmission message sent by the device is parsed to obtain the target environment data, including:
[0028] Parsing the message header of the transmission message to obtain the parsing rules of the correspondence between the grayscale image and the target environment data defined in the form of characters;
[0029] Verify the transmission message according to the parsing rules;
[0030] When the transmission message passes the verification, the transmission message is further parsed according to the parsing rules to obtain the target environment data.
[0031] A fifth aspect of the present application provides a data processing device, applied to a server, comprising:
[0032] Detection unit, receiving unit, sending unit and analysis unit; wherein:
[0033] A detection unit, used for the server to detect the network connection status between the server and the device;
[0034] A receiving unit, used to receive environmental data collected and sent by each device in the device end when the network connection state is normal;
[0035] A sending unit, used to initiate an environment data collection request to the device end when the duration of the abnormal network connection exceeds a preset time and the network connection state at the current moment is normal, wherein the environment data collection request is used to instruct the device end to determine the target environment data from the collected environment data, and send it to the server end after performing preset processing; the preset processing includes: processing the target environment data into a grayscale image, and compressing it into a transmission message according to a preset compression rule;
[0036] The parsing unit is used to receive and parse the transmission message sent by the device to obtain the target environment data.
[0037] In a sixth aspect, the present application provides a data processing device, applied to a device end, comprising at least one processor and a memory connected to the processor, wherein:
[0038] The memory is used to store computer programs;
[0039] The processor is used to execute a computer program so that the data processing device can implement the data processing method described in the fourth aspect or any implementation manner of the fourth aspect.
[0040] By means of the above technical scheme, the data processing method, device and equipment provided by the present application initiate an environmental data collection request to the device end when the server end detects that the duration of the abnormal network connection status with the device end exceeds the preset duration and the network connection status at the current moment is normal. After receiving the environmental data collection request, the device end determines the target environmental data from the collected environmental data, processes the target environmental data into a grayscale image, compresses it into a transmission message according to the preset compression rules, and sends it to the server end. The present application can compress all the environmental data to be obtained by the server end into a transmission message for transmission, and the server end can obtain the target environmental data at one time in a very short time. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0042] Figure 1 An example diagram of the distribution of intelligent sensing equipment in a tobacco aging warehouse provided for this application;
[0043] Figure 2 An example diagram of the internal environment of a tobacco aging warehouse provided for this application.
[0044] Correspondingly, see Figure 3 , an example diagram of a core temperature monitor provided in this application;
[0045] Figure 4 A flow chart of a data processing method provided in this application;
[0046] Figure 5 An example diagram of the server monitoring interface of the Hefei Cigarette Factory provided for this application;
[0047] Figure 6 An illustration of the grayscale dictionary provided for this application;
[0048] Figure 7 An example diagram of temperature data collected and stored locally by the environmental monitoring equipment provided in this application;
[0049] Figure 8 An example of a grayscale matrix image formed by thousands of environmental data provided in this application;
[0050] Fig. 9 An example of a grayscale matrix image formed by thousands of environmental data provided in this application;
[0051] Fig.10 A structural diagram of the data processing device applied to the device end provided by the present application;
[0052] Fig.11 Another flowchart of the data processing method provided in this application;
[0053] Fig.12 A flowchart of a data processing method provided in this application;
[0054] Fig.13 This is a structural diagram of the data processing device provided in this application for use on the server side. DETAILED DESCRIPTION
[0055] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0056] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0057] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0058] Environmental monitoring points are deployed in different environments to monitor environmental quality. Specifically, environmental monitoring equipment is set up at each environmental monitoring point in the same environment. The environmental monitoring equipment is responsible for collecting environmental monitoring data and uploading it to the database through the network.
[0059] Take the tobacco industry aging warehouse as an example, see Figure 1 , an example diagram of the distribution of intelligent sensing equipment in a tobacco aging warehouse provided in this application.
[0060] The storage environment of warehouses such as tobacco raw material warehouses requires the deployment of a large number of environmental monitoring equipment between warehouses to understand the changes in indicators such as environmental temperature and humidity during the storage of tobacco leaves. Figure 1 The circle in the figure is an environmental monitoring device deployed in the tobacco aging warehouse, which may be a wireless core temperature monitor or a wireless core composite monitor.
[0061] For example, see Figure 2 , is an example diagram of the internal environment of the tobacco aging warehouse provided in this application. Figure 3 , an example diagram of a core temperature monitor provided in this application.
[0062] It is understandable that the environmental monitoring device can be a wireless environmental monitoring device, and multiple environmental monitoring points need to be deployed in a tobacco aging warehouse. A 2,000-square-meter tobacco aging warehouse can store approximately 5,000 standard-sized cigarette packs. Wireless environmental monitoring devices are deployed at a ratio of 5% of the number of cigarette packs stored in the warehouse. A warehouse needs to deploy 250 core temperature collection devices, which are used to monitor the temperature of the tobacco leaves inside the cigarette packs. Changes in the internal temperature of the cigarette packs will cause corresponding thermochemical reactions, and different thermochemical reactions will occur accordingly as the temperature changes. The choice of monitoring the temperature of the tobacco leaves inside the cigarette packs is, on the one hand, that the tobacco leaf temperature is easy to collect, and on the other hand, temperature collection is the lowest comprehensive cost method among the monitoring methods.
[0063] For the core temperature collection device, assuming monitoring is performed once every 10 minutes, 144 temperature collection records will be generated every day. After each collection, each core temperature collection device transmits data through the Internet of Things protocol. The server receives the temperature data and parses it and stores it in the database. In addition, the core temperature collection device will also store and retain the temperature collection records locally.
[0064] When the core temperature collection device is located in a place with poor network conditions, or encounters abnormal network connection status with the server due to periodic network adjustments such as network maintenance, the temperature data cannot be reported for more than ten consecutive days or even longer. At this time, there will be thousands of temperature collection records in the core temperature collection device waiting to be uploaded to the server. It is necessary to wait for the network of the core temperature collection device to be restored or place the core temperature collection device to a place with better network conditions, and then read the temperature data stored in the core temperature collection device through the server.
[0065] In the known technology, the server usually captures thousands of temperature data. The capture process is unstable to a great extent. It is difficult to successfully capture thousands of data at one time. If the transmission fails, the staff needs to continue to operate to complete the missing or lost temperature data. The capture of a single core temperature acquisition device may require continuous operation for 2-4 hours, which takes a long time and requires investment in labor costs.
[0066] Another method of capturing temperature data in the known technology is to disassemble the core temperature acquisition device, directly capture the local data packet of the core temperature acquisition device through the serial port, and then parse and retain it. Disassembling the equipment requires staff to go to the location of the equipment, and the staff needs to have certain professional skills to ensure that the core temperature acquisition device will not be damaged when disassembling it. This method, on the one hand, has certain technical requirements for the staff, and on the other hand, it will depreciate the core temperature acquisition device to a certain extent.
[0067] It can be seen from this that various methods of obtaining environmental monitoring data from environmental monitoring equipment in the known technology at one time require a long time and it is difficult to obtain it successfully at one time.
[0068] In order to solve the above problems, the present application provides a data processing method, device and equipment.
[0069] It should be noted that the present application can be applied to tobacco aging warehouses, grain storage warehouses, and other warehouses or factories where environmental monitoring equipment can be installed.
[0070] See also Figure 4 , a flow chart of the data processing method provided in this application.
[0071] The data processing method provided in this specific embodiment is applied to the device side, such as Figure 4 As shown, the data processing method includes the following steps:
[0072] Step 101: Receive an environment data collection request initiated by a server, and determine target environment data corresponding to the environment data collection request.
[0073] It should be noted that the device side is the side where the environmental monitoring device that collects environmental monitoring data is located, and the server side can be understood as the data processing platform, server or database that interacts with the device side. When the network connection between the device side and the server side is normal, wireless or wired communication can be performed to exchange environmental data.
[0074] The environmental monitoring device at the device end can be a device that collects environmental data at a fixed frequency. Specifically, the environmental monitoring device sends the collected environmental data to the server end in a wireless or wired communication mode. For example, the core temperature collection device in the tobacco aging warehouse collects temperature data at a fixed frequency, reports the collected temperature data to the server end through the Internet of Things protocol, and retains it locally in the form of a timestamp.
[0075] It should be noted that the built-in storage chip of the environmental monitoring device can theoretically store 200,000 pieces of environmental data. Therefore, the environmental monitoring device can realize local retention of environmental data, ensuring that the environmental data is not lost when the environmental monitoring device is in a network abnormality for a long time.
[0076] The environmental data collection request determines the specific content of the requested environmental data based on the time when the device is disconnected from the network or in a weak network, and the specific situation of the missing environmental data. For example, if there are a few days of environmental data missing, a request will be made to obtain the environmental data of the corresponding days. The number of days of environmental data requested can be longer or shorter. In actual applications, the environmental data requested is generally within ten days.
[0077] The environmental data collection request includes the target device and the environmental data collection indication information. The target device refers to the environmental monitoring device that has been unable to upload the collected environmental data for more than ten consecutive days or even longer. For example, there are 250 core temperature collection devices in a tobacco aging warehouse. When the entire tobacco aging warehouse is disconnected from the network or in a weak network state, the 250 core temperature collection devices in the entire tobacco aging warehouse are target devices; when some of the 250 core temperature collection devices in the tobacco aging warehouse are in an abnormal network connection state such as disconnected from the network or in a weak network, some of the core temperature collection devices in an abnormal network connection state such as disconnected from the network or in a weak network are target devices. The target device needs to transmit the environmental data collected under abnormal network connection conditions to the server.
[0078] The data collection indication information may include the start time of the environmental data capture and the number of environmental data items.
[0079] For example, see Figure 5 , this application provides an example diagram of the server-side monitoring interface of Hefei Cigarette Factory.
[0080] The server collects the temperature data inside the cigarette packs through the wireless core temperature monitors installed in each alcoholization warehouse of the cigarette factory. Specifically, the wireless core temperature monitors are inserted into the cigarette packs through probes. The collection interval can be set by yourself, and the temperature data is generally collected every 10 minutes.
[0081] like Figure 5 As shown, each wireless core temperature monitor has its own device ID, asset number, device model, location information, real-time collected core temperature and core temperature reporting time, signal information, power of the wireless core temperature monitor, firmware version, operating status, online status and operation instruction information.
[0082] The environment data request sending interface can also view historical data, forwarding status, protocol logs, and perform event management.
[0083] It is understandable that the user can send a targeted environmental data collection request to the monitored device that lacks environmental data in this environmental data request sending interface on the server side. The environmental data collection request includes the start time of environmental data collection and the specific information of the environmental data to be captured. The start time of environmental data collection can be understood as the time period of the environmental data to be captured.
[0084] Each target device corresponds to its own target environment data, and the target environment data is the environment data collected at the same time interval. For example, the tobacco aging warehouse is basically in a sealed state, the air tightness between warehouses is good, and the overall change trend of the warehouse is not large. The wireless core temperature monitor is inserted into the cigarette package through a probe, and each collection interval is 10 minutes. Therefore, the overall change of general environmental temperature and humidity is not large, and the continuous monitoring temperature is basically the same. In a specific application scenario, the temperature extreme value change of the tobacco aging warehouse for about half a month is generally within 5°C, and the temperature collection accuracy is 0.1°C.
[0085] Optionally, the target device at the device end receives the environment data collection request, and the target device determines the target environment data that the server needs to capture based on the environment data collection indication information in the environment data collection request. Specifically, the target device determines the environment data that the server needs to capture based on the start time of the environment data collection in the environment data collection indication information.
[0086] Specifically, the target device will read the corresponding number of environmental data from the local storage according to the start time of environmental data collection and output an array. The amount of target environmental data that the server requests to capture from the target device is generally several thousand.
[0087] Step 102: Process the target environment data into a grayscale image, and compress the grayscale image into a transmission message according to a preset compression rule.
[0088] Since the target environmental data are collected at consistent intervals and the environment in which the environmental monitoring equipment is located does not change much, the target environmental data obtained through continuous monitoring are basically consistent.
[0089] For each environmental data monitoring device, a set of 256-level grayscale dictionaries will be preset. The collected target environmental data is filled into the grayscale dictionary according to the preset corresponding rules. It should be noted that the preset corresponding rules are specifically determined based on the data characteristics of the environmental data. For example, when the environmental data collected by the server is a temperature value, for the temperature value in the tobacco pack in the tobacco aging warehouse, the temperature value changes very little. The preset corresponding rule of minimum value + step size can be used to match the temperature value with the grayscale dictionary one by one, which is more in line with the specific scenario and easier to operate.
[0090] For example, see Figure 6, an illustration of the grayscale dictionary provided in this application.
[0091] like Figure 6 As shown, each color level is coded by a two-digit hexadecimal array: 00, 01, 02...FD, FE, FF, a total of 256 levels.
[0092] Taking the tobacco aging warehouse as an example, the temperature difference in the warehouse for half a month is generally within 5°C, and the accuracy of temperature collection can be as low as 0.1°C. It is understandable that the possible temperature values in thousands of temperature data are generally within 50. For example: 15.0°C, 15.1°C, 15.2°C, 15.3°C, ... 19.8°C, 19.9°C, 20.0°C...
[0093] The target device on the device side will remove duplicates from the target environment data to be transmitted to the server side to obtain a value range. For temperature data, the preset corresponding rule of minimum value + step length can be used to correspond all target environment data to the grayscale dictionary one by one. For the temperature data collected by the wireless core temperature monitor in the tobacco aging warehouse, 15.0℃ corresponds to 00, 15.1℃ corresponds to 01... and so on, with a maximum of no more than 256 types. If there are more than 256 types, a new color scale dictionary can be referenced, such as red, green, blue and other colors.
[0094] After the collected target environment data is filled into the grayscale dictionary according to the preset corresponding rules, a grayscale matrix image is generated. The grayscale matrix image can also be called a grayscale image.
[0095] For example, see Figure 7 , an example diagram of temperature data collected and stored locally by the environmental monitoring equipment provided in this application.
[0096] From the temperature data collected at hourly intervals by the environmental monitoring equipment on April 1, 2023, it can be seen that the temperature was 15.1°C in the eight hours from 00:00:05 to 08:00:05, the temperature at 09:00:03 changed to 15.2°C, and the temperature was 15.2°C for 13 consecutive hours from 09:00:03 to 22:00:04. The temperature collected at 23:00:01 was 15.3°C, and the temperature changed back to 15.2°C at 00:00:07 on April 2, 2023.
[0097] Depend on Figure 7 It can be seen that the temperature values of continuous monitoring are basically consistent, with very small fluctuations. It is common for more than ten or even dozens of consecutive temperature values to be the same. Figure 7 The temperature value changes within 0.3℃ for 24 hours.
[0098] For the case where the environmental data in the environmental monitoring equipment has a small variation range, when processing the environmental data, the continuously appearing data will be merged in the same type.
[0099] For example, the above Figure 7 The temperature value can be converted into: 0109-0214-0301-0201, that is, 15.1℃ corresponding to 01 appears 09 times in a row, 15.2℃ corresponding to 02 appears 14 times in a row, 15.3℃ corresponding to 03 appears once, and 15.2℃ corresponding to 02 appears once. The corresponding grayscale matrix image is as follows Figure 8 shown.
[0100] For example, see Fig. 9 , an example diagram of a grayscale matrix image formed by thousands of environmental data provided in this application.
[0101] Optionally, a preset corresponding rule is selected according to the data characteristics of the target environment data; according to the preset corresponding rule, the target environment data is matched with the grayscale dictionary one by one to obtain a grayscale matrix image. Further, the grayscale matrix image is compressed and encoded to obtain a transmission message.
[0102] The grayscale matrix image is encoded and compressed to obtain a message header of a parsing rule for a corresponding relationship between the grayscale matrix image and the target environment data defined in a character form, and the message header also includes the total number of target environment data.
[0103] For example, taking the temperature data of a tobacco aging warehouse as an example, 15.0 00 20 2400 means that the actual temperature is 15.0°C; the temperature step is 20, specifically 20 grayscale dictionaries are used, and 2400 represents the total number of temperature values, that is, all the data of the grayscale pattern are summarized as 2400 items.
[0104] It should be noted that the above-mentioned method of processing the target environment data into a grayscale image using a grayscale algorithm is an image generation method based on a neural network.
[0105] Step 103: Send the transmission message to the server so that the server can parse the transmission message into target environment data.
[0106] The target device on the device side sends the transmission message to the server side, and after receiving the transmission message, the server side decompresses the transmission message into the target environment data.
[0107] Specifically, the server-side analysis is generally performed in milliseconds, and even if the total number of target environment data is large, the analysis can be completed within 1-5 seconds. In contrast, the traditional analysis of each item in the known technology takes 1 second, and the analysis of thousands of data items takes several hours to complete even when the network is particularly stable.
[0108] To summarize, the data processing method provided in the present application for application on the device side determines the target environmental data according to the environmental data collection request sent by the server side, processes the target environmental data into a grayscale image, and compresses it into a transmission message according to a preset compression rule. Thousands of target environmental data can be transmitted to the server side in the form of messages at one time. The amount of data transmitted at one time is large and the transmission speed is fast.
[0109] For the above data processing method, the present application also provides a data processing device, the composition of which is as follows: Fig.10 shown.
[0110] A receiving unit 10, a processing unit 20 and a sending unit 30;
[0111] The receiving unit 10 is used to receive an environmental data collection request initiated by the server and determine target environmental data corresponding to the environmental data collection request;
[0112] The processing unit 20 is used to process the target environment data into a grayscale image, and compress the grayscale image into a transmission message according to a preset compression rule;
[0113] The sending unit 30 is used to send the transmission message to the server so that the server can parse the transmission message into target environment data.
[0114] In one embodiment, the receiving unit 10, the environment data collection request includes the target device and the environment data collection indication information, which is specifically used to:
[0115] A target device is selected from various devices at the device end, and target environmental data corresponding to the target device is determined according to the environmental data collection indication information; the target environmental data is environmental data collected at the same time interval.
[0116] In one embodiment, the processing unit 20, the grayscale image is a grayscale matrix image, specifically used for:
[0117] The target environment data is filled into a preset grayscale dictionary according to a preset corresponding rule to obtain a grayscale matrix image; the preset corresponding rule is determined according to the data characteristics of the target environment data.
[0118] In one embodiment, the processing unit 20 is specifically configured to:
[0119] The grayscale image is compressed and encoded to obtain a transmission message including key information; the key information includes a parsing rule of a correspondence between the grayscale image and the target environmental data defined in character form and the total number of environmental data items.
[0120] For the above data processing method, the present application also provides a data processing device, which is applied to a device end and includes at least one processor and a memory connected to the processor, wherein:
[0121] The memory is used to store computer programs;
[0122] The processor is used to execute the computer program so that the data processing device can implement the data processing method applied to the device side as described in any one of the above.
[0123] See also Fig.11 , another flow chart of the data processing method provided in this application.
[0124] The data processing method provided in this specific embodiment is applied to the server, such as Fig.11 As shown, the data processing method includes the following steps:
[0125] Step 201: The server detects the network connection status between the server and the device.
[0126] Depend on Figure 5 From the server monitoring interface of Hefei Cigarette Factory provided, it can be seen that the server will detect the network connection status of each device on the device side in real time.
[0127] Step 202: When the network connection status is normal, receive the environmental data collected and sent by each device in the device end.
[0128] When the network connection between the server and the device is normal, each device on the device collects environmental data according to the preset environmental data collection interval, saves the collected environmental data to local storage for retention, and at the same time, uses the applicable physical protocol to synchronously upload the collected environmental data to the server's database.
[0129] Step 203: When the duration of the abnormal network connection status exceeds the preset time and the network connection status at the current moment is normal, an environmental data collection request is initiated to the device end, and the environmental data collection request is used to instruct the device end to determine the target environmental data from the collected environmental data, and send it to the server end after preset processing; the preset processing includes: processing the target environmental data into a grayscale image, and compressing it into a transmission message according to preset compression rules.
[0130] The abnormal network connection status is caused by the poor network conditions at the location of the environmental monitoring equipment on the device side, network disconnection, network maintenance and other periodic network adjustments. When the server detects that the network connection status with some or all environmental monitoring equipment is abnormal, it will continue to detect these environmental monitoring equipment with abnormal network connection status until the network connection status between the server and these environmental monitoring equipment returns to normal.
[0131] When the server detects that the time period during which the environmental monitoring device is missing environmental data meets the preset time and the network connection status between the environmental monitoring device and the server has returned to normal at the current moment, it will send an environmental data collection request to the environmental monitoring device that meets the above conditions. The environmental data collection request instructs the environmental monitoring device to determine the target environmental data from the collected environmental data, process the target environmental data into a grayscale image, and compress it into a transmission message according to the preset compression rules.
[0132] It should be noted that the above preprocessing process is implemented by a method of image generation and compression transmission based on a neural network.
[0133] Step 204: Receive and parse the transmission message sent by the device to obtain the target environment data.
[0134] The server receives the transmission message sent by the device, and first parses the message header to obtain the parsing rules for the correspondence between the grayscale image and the target environment data defined in character form. According to the parsing rules, the grayscale image is de-encoded, and a consistency check is performed from left to right and from top to bottom. The consistency check includes whether the starting temperature and the grayscale dictionary correspond to each other, whether the total number of dictionaries and the total number of grayscales appear are consistent, and whether the grayscale digital synthesis and the total number of target environment data are consistent. After the consistency check passes, the server will further parse the transmission message to obtain the target environment data.
[0135] In summary, the data processing method provided by the present application initiates an environmental data collection request to the device side when the server side detects that the duration of the abnormal network connection status with the device side exceeds the preset duration and the network connection status at the current moment is normal. After receiving the environmental data collection request, the device side determines the target environmental data from the collected environmental data, processes the target environmental data into a grayscale image, compresses it into a transmission message according to the preset compression rules, and sends it to the server side. The present application can compress all the environmental data to be obtained by the server side into a transmission message for transmission, and the server side can obtain the target environmental data at one time in a very short time.
[0136] The data processing method provided in the present application adopts an adaptive graphic coding algorithm in hardware and software in a highly integrated form to ensure that the amount of data transmitted is relatively small, thereby realizing the one-time transmission of thousands of environmental data. Specifically, a grayscale algorithm is adopted to illustrate thousands of data in a grayscale visualization form according to the regularity of data appearance. The server can directly parse and obtain the target environmental data based on specific rules.
[0137] For example, see Fig.12 , a flow chart showing an example of a data processing method applied to a server provided in the present application.
[0138] The equipment collects data, transmits it and stores it locally. Specifically, when the network connection between the server and the device is normal, each device on the device side collects environmental data according to the preset environmental data collection interval, and saves the collected environmental data to the local storage for retention. At the same time, the collected environmental data is synchronously uploaded to the database of the server using an applicable physical protocol.
[0139] The server sends the start time of the re-capture. Specifically, when the server detects that the time period of the environmental monitoring device's missing environmental data meets the preset time and the network connection status between the environmental monitoring device and the server has returned to normal at this moment, the server will send the start time of the re-capture to the environmental monitoring device that needs to re-capture environmental data.
[0140] The device side selects the corresponding collection points. When the device side receives the start time of the supplementary capture, the environmental monitoring device will select the corresponding collection points, arrange the environmental data of the collection points, define the grayscale dictionary, generate a matrix and fill the data according to the grayscale dictionary, generate a grayscale image, and compress and transmit the grayscale image.
[0141] After receiving the compressed grayscale image, the server parses and generates environmental data.
[0142] For the above data processing method, the present application also provides a data processing device, the composition of which is as follows: Fig.13 shown.
[0143] Detection unit 100, receiving unit 200, sending unit 300 and parsing unit 400; wherein:
[0144] The detection unit 100 is used for the server to detect the network connection status between the server and the device;
[0145] The receiving unit 200 is used to receive the environmental data collected and sent by each device in the device end when the network connection state is normal;
[0146] The sending unit 300 is used to initiate an environment data collection request to the device end when the duration of the abnormal network connection exceeds a preset time and the network connection state at the current moment is normal, wherein the environment data collection request is used to instruct the device end to determine the target environment data from the collected environment data, and send it to the server end after performing preset processing; the preset processing includes: processing the target environment data into a grayscale image, and compressing it into a transmission message according to a preset compression rule;
[0147] The parsing unit 400 is used to receive and parse the transmission message sent by the device end to obtain the target environment data.
[0148] In one embodiment, the parsing unit 400 is specifically used to: parse the message header of the transmission message to obtain a parsing rule of the correspondence between the grayscale image and the target environment data defined in character form;
[0149] According to the analysis rule, verify the transmission message;
[0150] When the transmission message passes the verification, the transmission message is further parsed according to the parsing rule to obtain the target environment data.
[0151] Correspondingly, the present application also provides a data processing device, applied to a device end, comprising at least one processor and a memory connected to the processor, wherein:
[0152] The memory is used to store computer programs;
[0153] The processor is used to execute the computer program so that the data processing device can implement the data processing method applied to the server as described in any one of the above.
[0154] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0155] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0156] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0157] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A data processing method, characterized in that: Applied to the device side, including: Receive an environmental data collection request initiated by a server, and determine target environmental data corresponding to the environmental data collection request; Processing the target environment data into a grayscale image, and compressing the grayscale image into a transmission message according to a preset compression rule; The transmission message is sent to the server so that the server parses the transmission message into the target environment data.
2. The data processing method according to claim 1, characterized in that: The environmental data collection request includes a target device and environmental data collection indication information, and the determining of environmental data corresponding to the environmental data collection request includes: A target device is selected from the devices at the device end, and the target environmental data corresponding to the target device is determined according to the environmental data collection indication information; the target environmental data is environmental data collected at the same time interval.
3. The data processing method according to claim 1, characterized in that: The grayscale image is a grayscale matrix image; the processing of the target environment data into a grayscale image includes: The target environment data is filled into a preset grayscale dictionary according to a preset corresponding rule to obtain a grayscale matrix image; the preset corresponding rule is determined according to the data characteristics of the target environment data.
4. The data processing method according to claim 1, characterized in that: The step of compressing the grayscale image into a transmission message according to a preset compression rule includes: The grayscale image is compressed and encoded to obtain the transmission message including key information; the key information includes the parsing rules of the corresponding relationship between the grayscale image and the target environmental data defined in character form and the total number of environmental data.
5. A data processing device, characterized in that: Applied to the device side, including: Receiving unit, processing unit and sending unit; The receiving unit is used to receive an environment data collection request initiated by the server, and determine the target environment data corresponding to the environment data collection request; The processing unit is used to process the target environment data into a grayscale image, and compress the grayscale image into a transmission message according to a preset compression rule; The sending unit is used to send the transmission message to the server so that the server parses the transmission message into the target environment data.
6. A data processing device, characterized in that: Applied to a device, comprising at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the data processing device can implement the data processing method applied to the device end as described in any one of claims 1 to 4.
7. A data processing method, characterized in that: Applied to the server, including: The server detects the network connection status between it and the device; When the network connection state is normal, receiving the environmental data collected and sent by each device in the device end; When the duration of the abnormal network connection exceeds a preset time and the current network connection state is normal, an environment data collection request is initiated to the device end, wherein the environment data collection request is used to instruct the device end to determine target environment data from the collected environment data, and send the target environment data to the server end after performing preset processing; the preset processing includes: processing the target environment data into a grayscale image, and compressing it into a transmission message according to a preset compression rule; Receive and parse the transmission message sent by the device end to obtain the target environment data.
8. The data processing method according to claim 7, characterized in that: The parsing of the transmission message sent by the device to obtain the target environment data includes: Parsing a message header of the transmission message to obtain a parsing rule of a correspondence between the grayscale image and the target environment data defined in character form; According to the analysis rule, verify the transmission message; When the transmission message passes the verification, the transmission message is further parsed according to the parsing rule to obtain the target environment data.
9. A data processing device, characterized in that: Applied to the server, including: Detection unit, receiving unit, sending unit and analysis unit; wherein: The detection unit is used for the server to detect the network connection status between the server and the device; The receiving unit is used to receive the environmental data collected and sent by each device in the device end when the network connection state is normal; The sending unit is used to initiate an environment data collection request to the device end when the duration of the abnormal network connection exceeds a preset time and the network connection state at the current moment is normal, wherein the environment data collection request is used to instruct the device end to determine the target environment data from the collected environment data, and send it to the server end after performing preset processing; the preset processing includes: processing the target environment data into a grayscale image, and compressing it into a transmission message according to a preset compression rule; The parsing unit is used to receive and parse the transmission message sent by the device end to obtain the target environment data.
10. A data processing device, characterized in that: Applied to a device, comprising at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the data processing device can implement the data processing method applied to the server as described in any one of claims 7 to 8.
