Data processing method and device, equipment, storage medium and program product

By setting the domain to be calculated in the edge gateway and calculating the device data according to preset rules, the problem of high hardware requirements and performance problems of edge gateways is solved, and the effect of reducing the calculation frequency and improving performance is achieved.

CN119645668AActive Publication Date: 2025-03-18SHANGHAI ENVISION INNOVATION INTELLIGENT TECH CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510176688.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-18
Publication Date
2025-03-18
Estimated Expiration
2045-02-18

AI Technical Summary

Technical Problem

When deploying edge gateways on the edge side of IoT devices, frequent data processing requires high hardware requirements on edge gateways, especially when the hardware level is low, which can easily cause performance problems.

Method used

By setting a domain to be calculated in the edge gateway, after receiving the data group sent by the Internet of Things device, it compares the data identification of the device data in the data group with the data identification of the device data in the domain to be calculated, and performs calculations on the data data in the domain to be calculated according to the preset calculation rules to reduce the calculation frequency.

Benefits of technology

On the premise of ensuring real-time and accuracy of computing, reduce the frequency of edge gateway computing, save resource consumption, and improve equipment performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645668A_ABST
    Figure CN119645668A_ABST
Patent Text Reader

Abstract

The invention relates to a data processing method and device, equipment, a storage medium and a program product, and relates to the technical field of edge computing. The method is executed by an edge gateway in an Internet of Things system, and comprises the following steps: receiving a data group sent by a first Internet of Things device; traversing at least one piece of equipment data in the data set according to a sequence of the timestamps from first to second; under the condition that the first equipment data in the data group is traversed and the equipment data with the same data identifier and different timestamps as the first equipment data does not exist in the to-be-calculated domain of the edge gateway, adding the first equipment data to the to-be-calculated domain; and under the condition that the second equipment data in the data group is traversed and the equipment data with the same data identifier and different timestamps as the second equipment data exists in the to-be-calculated domain of the edge gateway, executing calculation on each piece of equipment data in the to-be-calculated domain according to a preset calculation rule. According to the scheme, the calculation frequency of the edge gateway can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of edge computing technology, and in particular to a data processing method, device, equipment, storage medium and program product. Background Art

[0002] With the development of Internet of Things technology, more and more devices are connected to the Internet, and the data of massive Internet of Things devices are uploaded to the cloud for processing, which greatly increases the data processing burden on the cloud.

[0003] In related technologies, an edge gateway can be deployed on the edge side of an IoT device. The IoT device sends all the data it collects to the edge gateway, which processes the data collected by the IoT device and then uploads the processed data to the cloud device.

[0004] However, every time an IoT device sends data, the edge gateway triggers data processing. Frequent data processing places high demands on the hardware of the edge gateway. If the hardware level of the edge gateway is low, it is easy to cause performance problems. Summary of the invention

[0005] The present application provides a data processing method, device, equipment, storage medium and program product. Without affecting the real-time performance of the calculation, the present solution can reduce the frequency of edge gateway calculation. The content of the technical solution is as follows.

[0006] According to one aspect of the present application, a data processing method is provided, the method comprising: Receive a data group sent by a first IoT device, wherein the data group includes at least one piece of device data, and the device data has a data identifier and a timestamp; Traversing at least one piece of the device data in the data group in the order of the timestamps from earliest to latest; When traversing to the first device data in the data group and there is no device data having the same data identifier and a different timestamp as the first device data in the to-be-calculated domain of the edge gateway, adding the first device data to the to-be-calculated domain; When traversing to the second device data in the data group, and there is device data with the same data identifier but different timestamp as the second device data in the to-be-calculated domain of the edge gateway, calculation is performed on each device data in the to-be-calculated domain according to preset calculation rules.

[0007] According to one aspect of the present application, a data processing device is provided, the device comprising: A receiving module, configured to receive a data group sent by a first IoT device, wherein the data group includes at least one piece of device data; the device data has a data identifier and a timestamp; A traversal module, used for traversing at least one piece of the device data in the data group in the order of the timestamps from earliest to latest; an adding module, configured to add the first device data to the to-be-calculated domain when the first device data in the data group is traversed and there is no device data having the same data identifier and a different timestamp as the first device data in the to-be-calculated domain of the edge gateway; A calculation module is used to perform calculations on each device data in the to-be-calculated domain according to preset calculation rules when traversing to the second device data in the data group and there is device data with the same data identifier but different timestamp as the second device data in the to-be-calculated domain of the edge gateway.

[0008] In some embodiments, the calculation rule includes at least two data identifiers of the device data; The calculation module is configured to, when traversing to the second device data in the data group and there is device data having the same data identifier as the second device data but a different timestamp in the to-be-calculated domain of the edge gateway, traverse at least two pieces of the device data in the to-be-calculated domain in the order of the timestamps from later to earlier; The calculation module is used to associate the first calculation rule with the third device data when the third device data in the domain to be calculated is traversed and the data identifier of the third device data corresponds to the first calculation rule, and there is no device data associated with the first calculation rule in the domain to be calculated, The calculation module is used to end the traversal of the third device data when the third device data is traversed, the data identifier of the third device data corresponds to the first calculation rule, and the device data associated with the first calculation rule exists in the to-be-calculated domain; The calculation module is used to perform calculation on each device data in the domain to be calculated according to a preset calculation rule when the traversal of at least two pieces of device data in the domain to be calculated is completed.

[0009] In some embodiments, the calculation module is used to traverse the at least two pieces of device data in the domain to be calculated in the order of the timestamps from earliest to latest when the traversal of the at least two pieces of device data in the domain to be calculated is completed; The calculation module is used for adding the fourth device data to the real-time library when the fourth device data in the to-be-calculated domain is traversed and the fourth device data is not associated with the calculation rule; The calculation module is used to add the fifth device data to the real-time library when the fifth device data is traversed and the fifth device data has been associated with the second calculation rule; query at least two device data corresponding to the second calculation rule from the real-time library; perform calculation on the at least two device data corresponding to the second calculation rule according to the second calculation rule to obtain first calculation data; set the timestamp of the fifth device data to the timestamp of the first calculation data; and add the first calculation data to the real-time library.

[0010] In some embodiments, the calculation module is used to query the real-time library for at least one candidate device data corresponding to a first data identifier; the first data identifier is any one of the data identifiers included in the second calculation rule; The calculation module is used to obtain the candidate device data with the latest corresponding timestamp among at least one of the candidate device data as the device data corresponding to the first data identifier among the at least two device data corresponding to the second calculation rule.

[0011] In some embodiments, the apparatus further comprises: a clearing module, configured to clear the domain to be calculated when the traversal of at least two pieces of the device data in the domain to be calculated is completed; The apparatus further includes: an updating module, configured to move the second device data and other device data in the data group whose timestamp is after the timestamp of the second device data, to the to-be-calculated domain.

[0012] In some embodiments, a timer is provided in the edge gateway; the apparatus further comprises: a timing module, configured to perform calculation on each device data in the to-be-calculated domain when the timer times out; The timing module is used to reset the timer after each calculation is completed on each device data in the to-be-calculated domain.

[0013] According to another aspect of the present application, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one computer instruction, and the at least one computer instruction is loaded and executed by the processor to implement the data processing method described above.

[0014] According to another aspect of the present application, a computer-readable storage medium is provided, wherein at least one computer instruction is stored in the computer-readable storage medium, and the at least one computer instruction is loaded and executed by a processor to implement the data processing method described above.

[0015] According to another aspect of the present application, a computer program product is provided, which includes computer instructions stored in a computer-readable storage medium, and a processor reads and executes the computer instructions from the computer-readable storage medium to implement the data processing method described above.

[0016] The technical solution provided by the embodiments of the present application may have the following beneficial effects: A domain to be calculated can be set in the edge gateway. After receiving the data group sent by the Internet of Things device, the edge gateway can compare the data identifier of the device data in the data group with the data identifier of the device data in the domain to be calculated. When the data identifier of the second device data in the data group is the same as the data identifier of a device data in the domain to be calculated, the device data in the data group with a timestamp earlier than the timestamp of the second device data is added to the domain to be calculated, and calculation is performed on each device data in the domain to be calculated; that is, the edge gateway can store the device data in the data group sent by the Internet of Things device in the domain to be calculated in the order of timestamps from first to last. When it is detected that the Internet of Things device has sent a data identifier that is the same as the device data in the domain to be calculated, a calculation is performed on the device data in the current domain to be calculated to avoid the situation where two device data in the domain to be calculated correspond to the same data identifier. Therefore, under the premise of ensuring the real-time and accuracy of the calculation, this solution can reduce the frequency of edge gateway calculation to save resource consumption of the edge gateway and ensure the device performance of the edge gateway. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0018] Figure 1 is a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application; Figure 2 is a flow chart of a data processing method provided by an exemplary embodiment of the present application; Figure 3 is a flow chart of a data processing method provided by another exemplary embodiment of the present application; Figure 4is an implementation flow chart of a data processing method provided by an exemplary embodiment of the present application; Figure 5 is a schematic diagram of a data processing method provided by an exemplary embodiment of the present application; Figure 6 is a schematic diagram of traversing device data provided in Embodiment 1 of the present application; Figure 7 This is a schematic diagram of traversing device data provided in Embodiment 2 of the present application; Figure 8 is a block diagram of a data processing device shown in an exemplary embodiment of the present application; Fig. 9 It is a structural block diagram of a computer device provided by an exemplary embodiment of the present application.

[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application. DETAILED DESCRIPTION

[0020] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0021] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0022] The terms used in the present disclosure are for the purpose of describing specific embodiments only and are not intended to limit the present disclosure. The singular forms "a", "said" and "the" used in the present disclosure and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise.

[0023] It should be understood that although the terms first, second, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first parameter may also be referred to as the second parameter, and similarly, the second parameter may also be referred to as the first parameter. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0024] The following is an introduction to the definitions of terms used in this application.

[0025] 1) Internet of Things (IoT): It is a network based on traditional communication networks, the Internet and other information carriers that enables all ordinary objects with independent functions to be interconnected. The IoT realizes the interconnection of all things by combining information technologies such as sensors, smart devices, cloud computing, big data, and artificial intelligence.

[0026] The IoT system consists of four main parts: the perception layer, the network layer, the platform layer (or data layer), and the application layer. The perception layer is the foundation of the IoT system and is responsible for data collection; the network layer is responsible for transmitting the data collected by the perception layer to the platform layer or application layer; the platform layer (or data layer) is the core of the IoT system and is responsible for data storage, processing, and analysis; the application layer is the user interface of the IoT system and is responsible for presenting the data processed by the platform layer to users in a way that is easy to understand and use.

[0027] 2) Edge Computing: At the edge of the network close to the data source, through a distributed open platform that integrates network, computing, storage, and application core capabilities, edge intelligent services are provided nearby to meet the key needs of industry digitalization in agile connectivity, real-time business, data optimization, application intelligence, security and privacy protection, etc.

[0028] Please refer to Figure 1 , which shows a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application. The implementation environment may include: an Internet of Things device 10, an edge gateway 20, and a cloud device 30.

[0029] With the rapid development of IoT technology, all industries are trying to transform digitally and connect more and more devices to the Internet, which means that a large amount of data from IoT devices 10 is uploaded to the cloud, greatly increasing the processing burden of cloud devices 30. The birth of edge computing solves the problem of difficult cloud processing of data from massive IoT devices 10.

[0030] Specifically, the edge gateway 20 works at the edge side of the IoT device 10 and receives data sent from the IoT device 10 to the edge gateway 20. The edge gateway 20 calculates and processes the data and sends the processed data to the cloud device 30.

[0031] The IoT device 10 is an IoT bottom-layer device with data collection and reporting capabilities, located in the perception layer of the IoT system, and can send the collected device data to the edge gateway 20. The IoT device 10 includes various sensors and smart terminal devices, such as temperature and humidity sensors, light sensors, accelerometers, particle counters, RFID readers, RFID tags, wearable devices, Bluetooth devices, etc., and also includes other types of IoT devices 10, which are not limited in this application.

[0032] Different application scenarios correspond to different IoT devices 10. For example, in the power IoT application scenario, the IoT devices 10 include transformers, electric meters, charging piles, temperature controllers, low-voltage main switches, fans, etc. For another example, in the smart home application scenario, the IoT devices 10 include monitoring, smart phones, smart TVs, smart doorbells, smart lights, etc. For another example, in the traffic control application scenario, the IoT devices 10 include traffic lights, power distribution facilities, smart vehicles, road cameras, etc.

[0033] The edge gateway 20 is an IoT gateway with edge computing capabilities, located at the network layer of the IoT system, connecting the IoT device 10 and the cloud device 30, and can realize the analysis and processing of massive IoT device data, and send the analyzed and processed data to the cloud device 30. Among them, the edge gateway 20 supports multiple network protocols and can flexibly access multiple IoT devices 10. For example, the network protocol is the RS-485 protocol, or the Radio Frequency Identification (RFID) protocol, or the Near Field Communication (NFC) protocol, or other network protocols, which are not limited in this application.

[0034] Optionally, data or information is transmitted between the cloud device 30 and the edge gateway 20 through the following network protocols: Message Queuing Telemetry Transport (MQTT) protocol, Hypertext Transfer Protocol (HTTP), Constrained Application Protocol (CoAP), or other network protocols, which are not limited in this application.

[0035] The cloud device 30 is a cloud computing platform with data storage, processing and analysis capabilities. It is located at the platform layer of the Internet of Things system and can extract valuable information through data mining, machine learning and other technologies to achieve visual management at the application layer.

[0036] Among them, an edge gateway 20 can receive device data sent by at least one IoT device 10.

[0037] In a data processing scheme involved in this application, each time the IoT device 10 sends data, the edge gateway 20 triggers data processing, which is easy to cause performance problems in edge computing scenarios with low hardware levels. Based on this, the subsequent embodiments of this application provide a new data processing method that can reduce the frequency of edge gateway 20 calculations.

[0038] Please refer to Figure 2 , which shows a flow chart of a data processing method provided by an exemplary embodiment of the present application. Figure 1 The edge gateway 20 shown is executed. Figure 2 As shown, the method may include step 210 , step 220 , step 230 and step 240 .

[0039] Step 210: Receive a data group sent by a first IoT device, where the data group includes at least one piece of device data; the device data has a data identifier and a timestamp.

[0040] In the IoT system, one edge gateway 20 corresponds to at least one IoT device 10. That is, the edge gateway 20 can receive a data group sent by at least one IoT device 10. When one edge gateway 20 is connected to at least two IoT devices 10, the first IoT device is one of the at least two IoT devices 10.

[0041] In an embodiment of the present application, the IoT device 10 (including the above-mentioned first IoT device) in the IoT system includes one or more data collection points, each data collection point regularly or irregularly collects its own device data, and the IoT device 10 regularly or irregularly reports the device data collected by each data collection point to the edge gateway 20; optionally, the data identifier of the above-mentioned device data is used to indicate the data collection point corresponding to the device data; that is, for the same data collection point, the device data collected at different times have the same data identifier and different timestamps.

[0042] The device data is a sensor reading in the first IoT device or a data value generated by another device. The data identifier is an identifier used to identify the device data; for example, the data identifier is a device ID, number or other identifier. The timestamp is used to record the time when the device data was generated; for example, the timestamp is a value accurate to milliseconds.

[0043] Exemplarily, the first IoT device collects at least one piece of device data and adds a corresponding data identifier and timestamp to the device data; then, the collected device data is encapsulated into a data group that conforms to the network protocol format, and then the data group is sent to the edge gateway 20 via the network protocol.

[0044] For example, if the first IoT device is a wind turbine for wind power generation, the data group sent by the wind turbine contains the following device data: wind speed, noise intensity, vibration intensity, etc. Among them, the wind speed corresponds to the measurement value of the wind speed sensor, the data identifier of the wind speed is the device number of the wind speed sensor (such as FG1), and the timestamp of the wind speed is the measurement time corresponding to the measurement value of the wind speed sensor; the noise intensity corresponds to the measurement value measured by the sound level meter, the data identifier of the noise intensity is the device number of the sound level meter (such as SJ1), and the timestamp of the noise intensity is the measurement time corresponding to the measurement value measured by the sound level meter; the vibration intensity corresponds to the measurement value of the vibration sensor, the data identifier of the vibration intensity is the device number of the vibration sensor (such as ZG1), and the timestamp of the vibration intensity is the measurement time corresponding to the measurement value of the vibration sensor.

[0045] In an embodiment of the present application, after receiving the data group sent by the first IoT device, the edge gateway 20 parses the data group to obtain the device data, as well as the data identifier and timestamp corresponding to the device data.

[0046] Optionally, the edge gateway 20 corresponds to at least one IoT device 10, and sends a data group containing at least one device data to the edge gateway 20 at different times. The data identifier of each device data in the data group 2 sent at the next moment is the same as, or different from, or partially the same as the data identifier of each device data in the data group 1 sent at the previous moment.

[0047] Step 220: traverse at least one device data in the data group in the order of timestamps from earliest to latest.

[0048] In an embodiment of the present application, the edge gateway 20 traverses the data identifier corresponding to at least one device data in the data group according to the timestamp corresponding to the device data, and manages at least one device data in the data group in an orderly manner, thereby ensuring the timing and consistency of the device data for subsequent analysis and processing.

[0049] Exemplarily, an input domain is set in the edge gateway 20 for storing at least one piece of device data sent by the first IoT device and received at the current moment. Accordingly, the edge gateway 20 stores the at least one piece of device data sent by the first IoT device in the input domain in the order of the timestamps from first to last. Afterwards, the edge gateway 20 starts traversing from the device data with the earliest timestamp.

[0050] Step 230: When the first device data in the data group is traversed and there is no device data with the same data identifier and different timestamp as the first device data in the to-be-calculated domain of the edge gateway 20, the first device data is added to the to-be-calculated domain.

[0051] That is, when the edge gateway 20 traverses the first device data in the data group that meets the specified condition, the device data is added to the domain to be calculated. The specified condition is that the data identifier of the first device data is the same as the data identifier of a device data in the domain to be calculated.

[0052] Among them, the to-be-calculated domain of the edge gateway 20 is used by the edge gateway 20 to store at least one device data in the data group sent by the first IoT device or other IoT devices 10 and received before the current moment.

[0053] Step 240: When the second device data in the data group is traversed and there is device data with the same data identifier but different timestamp as the second device data in the to-be-calculated domain of the edge gateway 20, calculation is performed on each device data in the to-be-calculated domain according to the preset calculation rules.

[0054] That is, when the edge gateway 20 traverses the device data that meets the unspecified condition in the data group, it stops traversing and starts to perform calculations on each device data in the calculation domain.

[0055] Among them, taking the data identifier of the second device data as number n as an example, there is device data with the same data identifier as the second device data and a different timestamp in the to-be-calculated domain of the above-mentioned edge gateway 20, which means that the to-be-calculated domain has stored device data with a data identifier of number n, that is, the first IoT device has sent a data group containing device data number n before sending a data group containing the second device data, and the previously sent device data number n has not been calculated; at this time, if the newly received device data number n is also directly put into the to-be-calculated domain, two or more device data with the same number will appear in the subsequent calculation, resulting in calculation errors. In order to ensure the real-time nature of the calculation and avoid errors in subsequent calculations, at this time, before putting the newly received device data number n into the to-be-calculated domain, the calculation is performed on each device data in the to-be-calculated domain.

[0056] In some embodiments, before the above step 220, the edge gateway 20 may query whether the current domain to be calculated has device data stored. If at least one piece of device data is stored in the current domain to be calculated, steps 220 to 240 are performed. If there is no device data stored in the current domain to be calculated, the edge gateway 20 adds at least one piece of device data in the data group received in step 210 to the domain to be calculated.

[0057] To sum up, in the scheme shown in the embodiment of the present application, a domain to be calculated can be set in the edge gateway 20. After receiving the data group sent by the Internet of Things device 10, the edge gateway 20 can compare the data identifier of the device data in the data group with the data identifier of the device data in the domain to be calculated. When the data identifier of the second device data in the data group is the same as the data identifier of a device data in the domain to be calculated, the device data in the data group whose timestamp is earlier than the timestamp of the second device data is added to the domain to be calculated, and calculation is performed on each device data in the domain to be calculated; that is, the edge gateway 20 can store the device data in the data group sent by the Internet of Things device 10 in the domain to be calculated in the order of timestamps from first to last. When it is detected that the Internet of Things device 10 has sent a data identifier that is the same as the device data in the domain to be calculated, a calculation is performed on the device data in the current domain to be calculated to avoid the situation where two device data correspond to the same data identifier in the domain to be calculated. Therefore, under the premise of ensuring the real-time and accuracy of the calculation, this scheme can reduce the frequency of calculation of the edge gateway 20 to save resource consumption of the edge gateway 20 and ensure the device performance of the edge gateway 20.

[0058] Based on the above Figure 2 In the solution in the illustrated embodiment, in a possible implementation solution, the calculation rule includes data identifiers of at least two device data.

[0059] The edge gateway 20 pre-stores calculation rules related to at least one corresponding IoT device 10 .

[0060] For example, based on the example that the first IoT device is a wind turbine, the calculation rule is: output value a=FG1+SJ1, or: output value b=SJ1×ZG1-FG1. When the edge gateway 20 performs calculations, the device data corresponding to the data identifier is substituted into the calculation rule to perform calculations.

[0061] Optionally, after the cloud device 30 establishes the calculation rules, it screens the calculation rules related to the edge gateway 20 and sends the calculation rules to the edge gateway 20; accordingly, the edge gateway 20 receives and stores the calculation rules sent by the cloud device 30.

[0062] The above step 240 may be implemented as step 240a, step 240b, step 240c and step 240d.

[0063] Step 240a: When the second device data in the data group is traversed, and there is device data with the same data identifier but different timestamp as the second device data in the to-be-calculated domain of the edge gateway 20, traverse at least two device data in the to-be-calculated domain in order of timestamps from later to earlier.

[0064] In an embodiment of the present application, the edge gateway 20 traverses the data identifiers corresponding to at least two pieces of device data in the domain to be calculated according to the timestamp corresponding to the device data, and manages the at least two pieces of device data in the domain to be calculated in an orderly manner, thereby ensuring the timing and consistency of the device data for subsequent analysis and processing.

[0065] Exemplarily, the edge gateway 20 starts traversing from the device data with the latest timestamp, and queries whether a calculation rule corresponding to the data identifier of the current device data is stored.

[0066] Step 240b: when the third device data in the domain to be calculated is traversed and the data identifier of the third device data corresponds to the first calculation rule, and there is no device data associated with the first calculation rule in the domain to be calculated, associate the first calculation rule with the third device data.

[0067] Among them, the data identifier of the above-mentioned third device data corresponds to the first calculation rule, which means that the data identifier of the third device data is included in the first calculation rule; there is no device data associated with the first calculation rule in the above-mentioned domain to be calculated, which means that the first calculation rule has not yet been associated with a certain device data in the domain to be calculated; at this time, the edge gateway 20 associates the first calculation rule to the third device data for subsequent calculation.

[0068] Step 240c: when the third device data is traversed, and the data identifier of the third device data corresponds to the first calculation rule, and there is device data associated with the first calculation rule in the to-be-calculated domain, the traversal of the third device data is terminated.

[0069] Among them, the presence of device data associated with the first calculation rule in the above-mentioned domain to be calculated means that the first calculation rule has been associated with a certain device data in the domain to be calculated; at this time, the edge gateway 20 ends the traversal of the third device data and continues to traverse the next device data.

[0070] Step 240d: when the traversal of at least two pieces of device data in the domain to be calculated is completed, calculation is performed on each piece of device data in the domain to be calculated according to a preset calculation rule.

[0071] After finding out the calculation rules corresponding to at least two pieces of device data in the domain to be calculated, the edge gateway 20 performs calculations on the at least two pieces of device data in the domain to be calculated according to the first calculation rule and other calculation rules to obtain output results corresponding to each calculation rule.

[0072] Since the calculation rules include data identifiers of at least two device data, the embodiment of the present application can filter out duplicate calculation rules before performing calculations on each device data in the calculation domain through orderly management of at least two device data in the calculation domain, thereby avoiding repeated calculations of the same calculation rules, saving resource consumption of the edge gateway 20, and improving the computing efficiency of the edge gateway 20.

[0073] Based on the solutions shown in the above-mentioned embodiments of the present application, in a possible implementation scheme, the above-mentioned step 240d can be implemented as step 240d1, step 240d2 and step 240d3.

[0074] Step 240d1: when the traversal of at least two pieces of device data in the domain to be calculated is completed, the at least two pieces of device data in the domain to be calculated are traversed in the order of timestamps from earliest to latest.

[0075] In an embodiment of the present application, the edge gateway 20 traverses the calculation rules corresponding to at least two device data in the domain to be calculated according to the timestamp corresponding to the device data, and manages the at least two device data in the domain to be calculated in an orderly manner, thereby ensuring the timing and consistency of the device data for subsequent analysis and processing.

[0076] Step 240d2: when the fourth device data in the to-be-calculated domain is traversed and the fourth device data is not associated with a calculation rule, the fourth device data is added to the real-time library.

[0077] Among them, the above-mentioned real-time library is a piece of memory opened by the edge gateway 20 in the process, which is used to store the device data in the data group sent by the Internet of Things device 10 and the calculation data of the edge gateway 20.

[0078] Optionally, the edge gateway 20 sends the device data and computing data in the real-time library to the cloud device 30 in real time, or the edge gateway 20 sends the device data and computing data in the real-time library to the cloud device 30 according to a specified period, so that the cloud device 30 can process and apply the device data and computing data.

[0079] Among them, the above-mentioned fourth device data is not associated with calculation rules. It may be that there is no calculation rule for the fourth device data; it may also be that the calculation rule of the fourth device data is associated with device data with a later timestamp. In order to avoid repeated calculations, at this time, the edge gateway 20 does not calculate the fourth device data and adds the fourth device data to the real-time library.

[0080] Step 240d3: When the fifth device data is traversed and the fifth device data has been associated with the second calculation rule, the fifth device data is added to the real-time library; at least two device data corresponding to the second calculation rule are queried from the real-time library; according to the second calculation rule, calculation is performed on the at least two device data corresponding to the second calculation rule to obtain the first calculation data; the timestamp of the fifth device data is set to the timestamp of the first calculation data; and the first calculation data is added to the real-time library.

[0081] The fifth device data is associated with the second calculation rule, which means that the fifth device data corresponds to the second calculation rule. Since the second calculation rule also includes the data identifier of at least one other device data, before performing calculation according to the second calculation rule, the edge gateway 20 can query the device data corresponding to other device identifiers in the second calculation rule.

[0082] Since in the process of associating the calculation rules, i.e., in the above steps 240a and 240b, the edge gateway 20 traverses at least two pieces of device data in the domain to be calculated in the order of timestamps from the last to the first, and in the process of executing the calculation, the edge gateway 20 traverses at least two pieces of device data in the domain to be calculated in the order of timestamps from the first to the last, therefore, the timestamp of the device data corresponding to other device identifiers in the second calculation rule is earlier than the timestamp of the fifth device data, and the corresponding device data has been stored in the real-time library. In other words, the timestamp of the fifth device data is the latest timestamp among the timestamps of at least two pieces of device data corresponding to the second calculation rule, and the edge gateway 20 can query the device data corresponding to other device identifiers in the second calculation rule in the real-time library.

[0083] After querying the device data corresponding to other device identifiers in the second calculation rule, the edge gateway 20 substitutes the fifth device data and the device data corresponding to other device identifiers into the second calculation rule to obtain the first calculation data. Afterwards, the edge gateway 20 determines the timestamp of the fifth device data as the timestamp of the first calculation data, and adds the first calculation data to the real-time library.

[0084] In an embodiment of the present application, after querying the relevant calculation rules in the order of timestamps from late to early, the edge gateway 20 can perform calculations on each device data in the calculation domain in the order of timestamps from early to late according to the queried calculation rules. This not only avoids repeated calculations of the same calculation rule, but also adds device data and calculation data to the real-time library according to timestamps. On the premise of ensuring the temporal sequence of data in the real-time library, it achieves calculation and storage at the same time, thereby improving the computing efficiency of the edge gateway 20.

[0085] Based on the solutions shown in the above embodiments of the present application, in a possible implementation scheme, querying at least two pieces of device data corresponding to the second calculation rule from the real-time library in the above step 240d3 can be implemented as follows: Querying the real-time database for at least one candidate device data corresponding to the first data identifier; the first data identifier is any one of the data identifiers included in the second calculation rule; The candidate device data with the latest corresponding timestamp among the at least one candidate device data is obtained as the device data corresponding to the first data identifier among the at least two device data corresponding to the second calculation rule.

[0086] In an embodiment of the present application, the edge gateway 20 obtains at least one data identifier included in the second calculation rule according to the second calculation rule; thereafter, the edge gateway 20 queries the real-time library for device data corresponding to the at least one data identifier.

[0087] Among them, since the real-time library stores device data in the data group previously sent by the first IoT device and other IoT devices 10, a data identifier may correspond to a unique candidate device data in the real-time library, or may correspond to at least two candidate device data with different timestamps.

[0088] Correspondingly, when a certain data identifier in the second calculation rule corresponds to at least two candidate device data, the edge gateway 20 determines the candidate device data with the latest timestamp as the device data corresponding to the data identifier.

[0089] Among them, the candidate device data with the latest timestamp refers to the candidate device data being the latest device data among the at least two candidate device data corresponding to the data identifier. By querying the latest device data in the real-time library, the embodiment of the present application can avoid the calculation of historical device data with the same data identifier, which can improve the accuracy of the device data selected by the edge gateway 20 to participate in the rule calculation, thereby improving the computing efficiency of the edge gateway 20, avoiding unnecessary computing processes, and saving resource consumption of the edge gateway 20.

[0090] Based on the solutions shown in the above embodiments, in a possible implementation solution, the above method further includes: When the traversal of at least two pieces of device data in the domain to be calculated is completed, the domain to be calculated is cleared; The second device data and other device data in the data group whose timestamp is after the timestamp of the second device data are moved to the to-be-calculated domain.

[0091] Among them, the traversal of at least two device data in the above-mentioned domain to be calculated is completed, which means that each device data in the domain to be calculated has been added to the real-time library. At this time, in order to save the storage space of the domain to be calculated, and in the process of subsequently adding new device data to the domain to be calculated, different device data with the same data identifier appears in the domain to be calculated, the edge gateway 20 clears each device data in the domain to be calculated.

[0092] The second device data and other device data in the data group whose timestamp is after the timestamp of the second device data refer to the device data that are not added to the domain to be calculated in step 220 and step 230 .

[0093] In an embodiment of the present application, the edge gateway 20 clears the domain to be calculated, and moves the second device data, as well as other device data in the data group whose timestamp is after the timestamp of the second device data, to the domain to be calculated, thereby achieving orderly management of the device data sent by the Internet of Things device 10, and performing calculation processing on the device data while ensuring the timing of the device data.

[0094] Based on the solutions shown in the above embodiments, a timer is provided in the edge gateway 20 .

[0095] The timer is a hardware component or a software component, which is used to trigger the calculation of each device data in the calculation domain after a preset time interval.

[0096] Exemplarily, when adding device data to the domain to be calculated, the edge gateway 20 starts the timer to record the storage time of the device data in the domain to be calculated.

[0097] Please refer to Figure 3 , which shows a flow chart of a data processing method provided by another exemplary embodiment of the present application. Figure 3 As shown, the above method also includes step 250 and step 260.

[0098] Step 250: When the timer times out, calculation is performed on each device data in the calculation domain.

[0099] Based on the above step 240, the embodiment of the present application shows another triggering condition for the edge gateway 20 to perform calculations on each device data in the calculation domain, namely, timer timeout.

[0100] The above timer timeout refers to the timer reaching a preset time interval.

[0101] Optionally, the preset time interval of the timer is 100ms, 150ms, 200ms, 300ms or other time intervals, which is not limited in the embodiments of the present application.

[0102] The execution process of performing calculations on each device data in the calculation domain is the same as the execution process of performing calculations on each device data in the calculation domain in the above step 240, and is not described in detail in this application.

[0103] Step 260: After each calculation is completed for each device data in the calculation domain, reset the timer.

[0104] The above-mentioned resetting of the timer refers to that the edge gateway 20 resets the time interval of the timer so that the timer starts timing again.

[0105] Since the edge gateway 20 clears the domain to be calculated after the calculation of each device data in the domain to be calculated is completed, the edge gateway 20 resets the timer in order to re-record the interval length of calculating each device data in the domain to be calculated.

[0106] By setting a timer, the embodiment of the present application controls the interval duration for performing calculations on each device data in the calculation domain within a reasonable range, thereby avoiding affecting the real-time performance of the calculations.

[0107] Based on the solutions shown in the above embodiments of this application, please refer to Figure 4 , which shows an implementation flow chart of a data processing method provided by an exemplary embodiment of the present application. Figure 4 As shown, a domain to be calculated and a timer are set in the edge gateway 20, and the domain to be calculated stores at least one device data in the data group sent by the Internet of Things device 10 to the edge gateway 20. Figure 4 The steps in are executed by the edge gateway 20, and specifically include the following steps.

[0108] Step 401: Determine whether the timer has timed out.

[0109] If yes, execute step 406; otherwise, execute step 402.

[0110] Step 402: Receive a data group sent by a first IoT device and store it in an input field.

[0111] The data group includes at least one piece of device data; the device data has a data identifier and a timestamp.

[0112] Step 403: traverse at least one piece of device data in the input domain in the order of timestamps from earliest to latest.

[0113] Step 404: Determine whether the traversed device data has the same data identifier but a different timestamp as the device data in the domain to be calculated.

[0114] If yes, execute step 406; otherwise, execute step 405.

[0115] Step 405: Add the traversed device data to the domain to be calculated. Then, continue to traverse the next device data.

[0116] Step 406: When the timer times out, traverse at least two pieces of device data in the domain to be calculated in order of timestamps from the last to the first.

[0117] Step 407: Determine whether the traversed device data corresponds to the first calculation rule.

[0118] If yes, execute step 408; otherwise, continue to traverse the next device data.

[0119] Step 408: Determine whether there is device data associated with the first calculation rule in the domain to be calculated. If so, continue to traverse the next device data; otherwise, execute step 409.

[0120] Step 409: Associating the first calculation rule with the traversed device data.

[0121] Step 410: Determine whether the traversal is completed.

[0122] If yes, execute step 411; otherwise, continue traversing.

[0123] Step 411: traverse at least two pieces of device data in the domain to be calculated in the order of timestamps from earliest to latest.

[0124] Step 412: Add the traversed device data to the real-time library.

[0125] Step 413: Determine whether the traversed device data is associated with the calculation rule.

[0126] If yes, execute step 414; otherwise, execute step 412 to continue traversing.

[0127] Step 414: Obtain the first calculation data, and set the timestamp of the traversed device data as the timestamp of the first calculation data.

[0128] Step 415: Add the first calculation data to the real-time library.

[0129] Among them, the execution method of step 401 to step 415 is the same as the execution method of the above-mentioned embodiments of the present application, and will not be repeated here.

[0130] Please refer to Figure 5 , which shows a schematic diagram of a data processing method provided by an exemplary embodiment of the present application. Figure 5As shown, the IoT devices 10 connected to the edge gateway 20 are IoT device A, IoT device B, IoT device C and other IoT devices 10 (not shown in the figure).

[0131] Among them, the edge gateway 20 establishes an MQTT connection with the configuration center in the cloud. After the configuration center in the cloud builds the calculation rules, all configuration information related to the edge gateway 20 is packaged and sent to the edge gateway 20 through the MQTT connection; accordingly, the edge gateway 20 receives the resource package sent by the cloud through the MQTT connection, and extracts the calculation rules after parsing the resource package.

[0132] IoT device A, IoT device B, and IoT device C can send data groups containing at least one device data to the edge gateway 20 at different times. Exemplarily, the data group sent by IoT device A contains three device data, namely a_in1 (X1ms), a_in2 (X2ms), and a_in3 (X3ms), wherein a_in1, a_in2, and a_in3 correspond to the data identifiers of the three device data, respectively, and X1ms, X2ms, and X3ms correspond to the timestamps of the three device data, respectively. The data group sent by IoT device B contains three device data, namely b_in1 (Y1ms), b_in2 (Y2ms), and b_in3 (Y3ms). The data group sent by IoT device C contains three device data, namely c_in1 (Z1ms), c_in2 (Z2ms), and c_in3 (Z3ms).

[0133] In the embodiment of the present application, after the edge gateway 20 receives the data group sent by the IoT device A, the IoT device B, the IoT device C or other IoT devices 10, it will first perform packet aggregation.

[0134] Specifically, the edge gateway 20 stores at least one device data in the received data group into the input domain. Since different IoT devices 10 can send data groups to the edge gateway 20 at different times, the device data received by the edge gateway 20 is usually out of order. Accordingly, the edge gateway 20 traverses each device data in the input domain in the order of timestamps from first to last.

[0135] Secondly, during the packet aggregation process, if the edge gateway 20 finds that there is device data with the same data identifier but different timestamps in the input domain and the domain to be calculated (i.e., duplicate points), such as device data 1 (i.e., the second device data mentioned above), it will immediately trigger the edge gateway 20 to calculate each device data in the domain to be calculated and reset the packet aggregation timer.

[0136] Specifically, the edge gateway 20 extracts device data with a timestamp earlier than device data one from the input domain, and moves the device data in an orderly manner to the domain to be calculated; thereafter, the edge gateway 20 performs calculations on each device data in the domain to be calculated according to the calculation rules issued by the cloud.

[0137] In addition, during the packet aggregation process, if the packet aggregation timer times out, the edge gateway 20 is triggered to calculate the data of each device in the calculation domain.

[0138] In addition, if no duplicate points are found within a packet aggregation cycle but the packet aggregation timer times out, the edge gateway 20 will be triggered to calculate the data of each device in the calculation domain.

[0139] In the process of edge gateway 20 calculating the device data in the calculation domain, in order to avoid repeated calculation, the device data in the domain to be calculated are first merged and sorted into a total ordered device data, and then traversed in reverse order according to the timestamp of the device data to find all the required calculation rules.

[0140] To ensure that the device data is output to the real-time database in an orderly manner, the device data is traversed in order of its timestamp, and the method of calculating and storing the data at the same time is adopted to ensure that the device data and the calculated data obtained by the calculation rules are stored in the order of the timestamps.

[0141] Embodiment 1 IoT device A sends the first data group 1 to the edge gateway 20 at 110ms. The data group 1 includes device data a_in1 (100ms), device data a_in2 (105ms) and device data a_in3 (110ms). At this time, no other device data is stored in the domain to be calculated, so the device data in data group 1 is directly placed in the domain to be calculated. When the packet aggregation timer times out and the edge gateway 20 does not receive other data groups, the edge gateway 20 arranges all device data in the domain to be calculated into a queue from small to large according to the timestamp, traverses from the tail of the queue forward, and obtains the corresponding calculation rules. Among them, calculation rule 1: a_out1=a_in1+a_in2.

[0142] Please refer to Figure 6 , which shows a schematic diagram of traversing device data provided by the first embodiment of the present application. Figure 6As shown, first, the edge gateway 20 traverses a_in3 (110ms) and finds that there is no corresponding calculation rule, so it is ignored; the edge gateway 20 traverses to a_in2 (105ms) and finds that there is a corresponding calculation rule one, and hangs the calculation rule one after the point a_in2 (105ms); the edge gateway 20 traverses to a_in1 (100ms) and finds that there is a corresponding calculation rule one, but at this time the calculation rule one already exists and is ignored.

[0143] Secondly, after the edge gateway 20 obtains the calculation rules, it traverses all device data from the head of the queue and performs calculations. The entire calculation process is: a_in1(100ms) enters the real-time library; a_in2(105ms) enters the real-time library; According to calculation rule 1, the latest equipment data sections a_in1 (100ms) and a_in2 (105ms) are retrieved from the real-time database to obtain the calculated data a_out1, which is timestamped as 105ms, and a_out1 (105ms) is stored in the real-time database. a_in3(110ms) enters the real-time library.

[0144] After the above calculation process is completed, the edge gateway 20 clears the data of each device in the domain to be calculated and resets the packet aggregation timer.

[0145] At this point, the device data a_in1 (100ms), a_in2 (105ms), a_out1 (105ms), and a_in3 (110ms) already exist in the real-time library.

[0146] Subsequently, IoT device A sends the first data group 2 to the edge gateway 20 at 500ms, and the data group 2 includes device data a_in1 (500ms), device data a_in2 (505ms), and device data a_in3 (510ms). At this time, no other device data is stored in the domain to be calculated, so the device data in data group 2 is directly placed in the domain to be calculated. When the packet aggregation timer times out and the edge gateway 20 does not receive other data groups, the edge gateway 20 arranges all device data in the domain to be calculated into a queue from small to large according to the timestamp, traverses from the tail of the queue forward, and obtains the corresponding calculation rules. Among them, calculation rule one: a_out1=a_in1+a_in2.

[0147] First, the edge gateway 20 traverses a_in3 (510ms) and finds that there is no corresponding calculation rule, so it is ignored; the edge gateway 20 traverses to a_in2 (505ms) and finds that there is a corresponding calculation rule one, and hangs the calculation rule one after the point a_in2 (505ms); the edge gateway 20 traverses to a_in1 (500ms) and finds that there is a corresponding calculation rule one, but at this time the calculation rule one already exists and is ignored.

[0148] Secondly, after the edge gateway 20 obtains the calculation rules, it traverses all device data from the head of the queue and performs calculations. The entire calculation process is: a_in1(500ms) enters the real-time library; a_in2(505ms) enters the real-time library; According to calculation rule 1, the latest equipment data sections a_in1 (500ms) and a_in2 (505ms) are retrieved from the real-time database to obtain the calculated data a_out1, which is timestamped as 505ms, and a_out1 (505ms) is stored in the real-time database. a_in3(510ms) enters the real-time library.

[0149] After the above calculation process is completed, the edge gateway 20 clears the data of each device in the domain to be calculated and resets the packet aggregation timer.

[0150] At this point, the real-time library already has device data a_in1(100ms), a_in2(105ms), a_out1(105ms), a_in3(110ms), a_in1(500ms), a_in2(505ms), a_out1(505ms), and a_in3(510ms).

[0151] Embodiment 2 Device data c_in3 (100ms) already exists in the real-time database. At this time, IoT device A collects and uploads a data group 3, which includes device data a_in2 (105ms), device data a_in3 (115ms), device data a_in1 (200ms), device data a_in2 (205ms), and device data a_in3 (210ms). At the same time, the domain to be calculated already contains a_in1 (100ms) of IoT device A, b_in1 (110ms), b_in2 (120ms), b_in3 (130ms) of IoT device B, and c_in1 (125ms), c_in2 (135ms) of IoT device C.

[0152] Please refer to Figure 7 , which shows a schematic diagram of traversing device data provided by the second embodiment of the present application. Figure 7As shown, first, the device data traverses a_in2 (105ms) and a_in3 (115ms), and finds no corresponding calculation rules, so it is ignored; when the edge gateway 20 traverses to a_in1 (200ms), it finds that the device data a_in1 (100ms) with the same data identifier already exists in the domain to be calculated, then the device data a_in2 (105ms) and a_in3 (115ms) before a_in1 (200ms) are put into the domain to be calculated, and a calculation is performed, and the device data a_in2 (205ms) and a_in3 (210ms) after a_in1 (200ms) are suspended and stored in the input domain, waiting for the next traversal.

[0153] Secondly, all device data in the domain to be calculated are arranged into a queue from small to large timestamps. The time complexity of this step is O(n log(k)), where k represents the number of devices involved in the calculation. The edge gateway 20 traverses from the tail of the queue to obtain the corresponding calculation rules. Among them, calculation rule 2: b_out1=a_in3+b_in1; calculation rule 3: b_out2=a_in1*b_in2; calculation rule 4: c_out1=a_in2+b_in3+c_in2-c_in3; calculation rule 5: c_out2=c_in1 / c_in2.

[0154] Then, the edge gateway 20 traverses to c_in2 (135ms), and finds that there are corresponding calculation rules 4 and 5, and hangs calculation rules 4 and 5 after point c_in2 (135ms); traverses to b_in3 (130ms), and finds that there is corresponding calculation rule 4, but calculation rule 4 already exists at this time, so it is ignored; the edge gateway 20 traverses to c_in1 (125ms), and finds that there is corresponding calculation rule 5, but calculation rule 5 already exists at this time, so it is ignored; the edge gateway 20 traverses to b_in2 (120ms), and finds that there is corresponding calculation rule 3, and hangs calculation rule 3 at point b_in2 ( 120ms); the edge gateway 20 traverses to a_in3 (115ms), finds the corresponding calculation rule 2, and hangs the calculation rule 2 at point a_in3 (115ms); the edge gateway 20 traverses to b_in1 (110ms), finds the corresponding calculation rule 2, but at this time the calculation rule 2 already exists and is ignored; the edge gateway 20 traverses to a_in2 (105ms), finds the corresponding calculation rule 4, but at this time the calculation rule 4 already exists and is ignored; the edge gateway 20 traverses to a_in1 (100ms), finds the corresponding calculation rule 3, but at this time the calculation rule 3 already exists and is ignored.

[0155] After the edge gateway 20 obtains the calculation rules, it traverses all device data from the head of the queue and performs calculations. The entire calculation process is: a_in1(100ms) enters the real-time library; a_in2(105ms) enters the real-time library; b_in1(110ms) enters the real-time library; a_in3 (115ms) enters the real-time library; According to calculation rule 2, the latest input data sections b_in1 (110ms) and a_in3 (115ms) are retrieved from the real-time database to obtain the calculated data b_out1, which is timestamped as 115ms, and b_out1 (115ms) is stored in the real-time database. b_in2(120ms) enters the real-time library; According to calculation rule 3, the latest input data sections a_in1 (100ms) and b_in2 (120ms) are retrieved from the real-time database to obtain the calculated data b_out2, which is timestamped as 120ms and b_out2 (120ms) is stored in the real-time database. c_in1(125ms) enters the real-time library; b_in3 (130ms) enters the real-time library; c_in2 (135ms) enters the real-time library; According to calculation rule 4, the latest input data sections a_in2 (105ms), b_in3 (130ms), c_in2 (135ms) and c_in3 (100ms) are retrieved from the real-time database to obtain the calculated data c_out1, which is timestamped as 135ms, and c_out1 (135ms) is stored in the real-time database. According to calculation rule five, the latest input data sections c_in1 (125ms) and c_in2 (135ms) are retrieved from the real-time database to obtain the calculated data c_out2, which is timestamped as 135ms, and c_out2 (135ms) is stored in the real-time database.

[0156] After the above calculation process is completed, the edge gateway 20 clears the data of each device in the domain to be calculated and resets the packet aggregation timer.

[0157] At this point, the real-time library already has device data c_in3 (100ms), a_in1 (100ms), a_in2 (105ms), b_in1 (110ms), a_in3 (115ms), b_out1 (115ms), b_in2 (120ms), b_out2 (120ms), c_in1 (125ms), b_in3 (130ms), c_in2 (135ms), c_out1 (135ms), and c_out2 (135ms).

[0158] It should be noted that the edge gateway 20 can send the ordered device data and computing data in the real-time library to the cloud in real time so that the cloud can process and apply the device data and computing data.

[0159] In summary, this method can be widely used in scenarios that require fast response and instant insight, such as the common power merging of electric meter branches. After reporting at the branch collection point, the power of multiple branches needs to be aggregated into a total power report. For example, in the integrated photovoltaic storage and charging scenario, by reading the working status and total active power, it is possible to determine whether the energy storage system is currently charging or discharging. For example, after installing a particle counter in a laboratory with dust-free requirements, it is necessary to perform periodic averaging on the reported values ​​of the counter to achieve real-time monitoring of the number of particles. For example, when a wind turbine is generating electricity, the real-time power generation power of the wind turbine is calculated by wind speed, blade radius, and power coefficient.

[0160] Please refer to Figure 8 , which shows a block diagram of a data processing device shown in an exemplary embodiment of the present application, the device can be used to perform the following Figure 2 or Figure 3 In the method shown, all or part of the steps performed by the computer device are as follows Figure 8 As shown, the device comprises: The receiving module 801 is used to receive a data group sent by a first IoT device, where the data group includes at least one piece of device data; the device data has a data identifier and a timestamp; A traversal module 802, configured to traverse at least one piece of device data in a data group in the order of timestamps from earliest to latest; An adding module 803 is used to add the first device data to the to-be-calculated domain when the first device data in the data group is traversed and there is no device data with the same data identifier and different timestamp as the first device data in the to-be-calculated domain of the edge gateway 20; The calculation module 804 is used to perform calculations on each device data in the calculation domain according to preset calculation rules when the second device data in the data group is traversed and there is device data with the same data identifier but different timestamp as the second device data in the calculation domain of the edge gateway 20.

[0161] In some embodiments, the calculation rule includes data identification of at least two device data; The calculation module 804 is used to traverse at least two pieces of device data in the to-be-calculated domain in the order of the timestamps from the later to the earlier, when the second device data in the data group is traversed and there is device data with the same data identifier as the second device data and a different timestamp in the to-be-calculated domain of the edge gateway 20; The calculation module 804 is used to associate the first calculation rule with the third device data when the third device data in the domain to be calculated is traversed and the data identifier of the third device data corresponds to the first calculation rule, and there is no device data associated with the first calculation rule in the domain to be calculated; The calculation module 804 is used to end the traversal of the third device data when the third device data is traversed, and the data identifier of the third device data corresponds to the first calculation rule, and the device data associated with the first calculation rule exists in the to-be-calculated domain; The calculation module 804 is used to perform calculation on each device data in the domain to be calculated according to a preset calculation rule when the traversal of at least two pieces of device data in the domain to be calculated is completed.

[0162] In some embodiments, the calculation module 804 is used to traverse the at least two pieces of device data in the domain to be calculated in a time stamp-to-time order when the traversal of the at least two pieces of device data in the domain to be calculated is completed; The calculation module 804 is used to add the fourth device data to the real-time library when the fourth device data in the to-be-calculated domain is traversed and the fourth device data is not associated with the calculation rule; The calculation module 804 is used to add the fifth device data to the real-time library when the fifth device data is traversed and the fifth device data has been associated with the second calculation rule; query at least two device data corresponding to the second calculation rule from the real-time library; perform calculation on the at least two device data corresponding to the second calculation rule according to the second calculation rule to obtain the first calculation data; set the timestamp of the fifth device data to the timestamp of the first calculation data; and add the first calculation data to the real-time library.

[0163] In some embodiments, the calculation module 804 is used to query the real-time library for at least one candidate device data corresponding to the first data identifier; the first data identifier is any one of the data identifiers included in the second calculation rule; The calculation module 804 is used to obtain a candidate device data with the latest corresponding timestamp among the at least one candidate device data as the device data corresponding to the first data identifier among the at least two device data corresponding to the second calculation rule.

[0164] In some embodiments, the apparatus further comprises: a clearing module, configured to clear the domain to be calculated when the traversal of at least two pieces of device data in the domain to be calculated is completed; The apparatus further includes: an updating module, which is used to move the second device data and other device data in the data group whose timestamp is after the timestamp of the second device data to the domain to be calculated.

[0165] In some embodiments, a timer is provided in the edge gateway 20; the apparatus further comprises: a timing module, for performing calculations on each device data in the calculation domain when the timer times out; The timing module is used to reset the timer after each calculation of each device data in the calculation domain is completed.

[0166] One point that needs to be explained is that the device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example to implement its functions. In actual applications, the above-mentioned functions can be assigned to different functional modules according to actual needs, that is, the content structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0167] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method; the technical effects achieved by each module performing operations are the same as those in the embodiment of the method, and will not be elaborated here.

[0168] Please refer to Fig. 9 , which shows a structural block diagram of a computer device 900 shown in an exemplary embodiment of the present application. The computer device can be implemented as a server in the above-mentioned solution of the present application. The computer device 900 includes a central processing unit (CPU) 901, a system memory 904 including a random access memory (RAM) 902 and a read-only memory (ROM) 903, and a system bus 905 connecting the system memory 904 and the central processing unit 901. The computer device 900 also includes a large-capacity storage device 906 for storing an operating system 909, an application program 910 and other program modules 911.

[0169] The mass storage device 906 is connected to the central processing unit 901 via a mass storage controller (not shown) connected to the system bus 905. The mass storage device 906 and its associated computer readable medium provide non-volatile storage for the computer device 900. That is, the mass storage device 906 may include a computer readable medium (not shown) such as a hard disk or a Compact Disc Read-Only Memory (CD-ROM) drive.

[0170] Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, Erasable Programmable Read Only Memory (EPROM), Electronically-Erasable Programmable Read-Only Memory (EEPROM) flash memory or other solid-state storage technology, CD-ROM, Digital Versatile Disc (DVD) or other optical storage, tape cassettes, tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will know that the computer storage medium is not limited to the above. The above-mentioned system memory 904 and mass storage device 906 can be collectively referred to as memory.

[0171] According to various embodiments of the present disclosure, the computer device 900 can also be connected to a remote computer on the network through a network such as the Internet. That is, the computer device 900 can be connected to the network 908 through the network interface unit 907 connected to the system bus 905, or the network interface unit 907 can be used to connect to other types of networks or remote computer systems (not shown).

[0172] The memory also includes at least one computer instruction, which is stored in the memory. The central processing unit 901 implements all or part of the steps in the methods shown in the above embodiments by executing the at least one computer instruction.

[0173] In an exemplary embodiment, a chip is also provided. The chip includes a programmable logic circuit and program instructions. When the chip runs on a computer device, it is used to implement the data processing method in the above aspect.

[0174] In an exemplary embodiment, a computer program product is also provided, the computer program product includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor reads and executes the computer instructions from the computer-readable storage medium to implement the data processing methods provided in the above-mentioned method embodiments.

[0175] In an exemplary embodiment, a computer-readable storage medium is also provided, in which computer instructions are stored. The computer instructions are loaded and executed by a processor to implement the data processing methods provided by the above-mentioned method embodiments.

[0176] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0177] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.

[0178] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A data processing method, characterized in that: The method is performed by an edge gateway in an Internet of Things system, and the method includes: Receive a data group sent by a first IoT device, wherein the data group includes at least one piece of device data, and the device data has a data identifier and a timestamp; Traversing at least one piece of the device data in the data group in the order of the timestamps from earliest to latest; When traversing to the first device data in the data group and there is no device data having the same data identifier and a different timestamp as the first device data in the to-be-calculated domain of the edge gateway, adding the first device data to the to-be-calculated domain; When traversing to the second device data in the data group, and there is device data with the same data identifier as the second device data and a different timestamp in the to-be-calculated domain of the edge gateway, traversing at least two pieces of the device data in the to-be-calculated domain in the order of the timestamps from later to earlier; When traversing to the third device data in the domain to be calculated, and the data identifier of the third device data corresponds to the first calculation rule, and there is no device data associated with the first calculation rule in the domain to be calculated, associating the first calculation rule with the third device data; When the third device data is traversed, and the data identifier of the third device data corresponds to the first calculation rule, and the device data associated with the first calculation rule exists in the to-be-calculated domain, the traversal of the third device data is terminated; When the traversal of at least two pieces of the device data in the domain to be calculated is completed, calculation is performed on each piece of the device data in the domain to be calculated according to a preset calculation rule; the calculation rule includes data identifiers of at least two pieces of the device data.

2. The method according to claim 1, characterized in that When the traversal of at least two pieces of device data in the domain to be calculated is completed, performing calculation on each piece of device data in the domain to be calculated according to a preset calculation rule includes: When the traversal of at least two pieces of the device data in the domain to be calculated is completed, traversing the at least two pieces of the device data in the domain to be calculated in the order of the timestamps from earliest to latest; When traversing to the fourth device data in the to-be-calculated domain and the fourth device data is not associated with the calculation rule, adding the fourth device data to the real-time library; When traversing to the fifth device data and the fifth device data has been associated with the second calculation rule, the fifth device data is added to the real-time library; at least two device data corresponding to the second calculation rule are queried from the real-time library; according to the second calculation rule, calculation is performed on the at least two device data corresponding to the second calculation rule to obtain first calculation data; the timestamp of the fifth device data is set to the timestamp of the first calculation data; and the first calculation data is added to the real-time library.

3. The method according to claim 2, characterized in that The querying the at least two pieces of device data corresponding to the second calculation rule from the real-time library includes: querying the real-time database for at least one candidate device data corresponding to a first data identifier; the first data identifier is any one of the data identifiers included in the second calculation rule; The candidate device data having the latest corresponding timestamp among at least one of the candidate device data is acquired as the device data corresponding to the first data identifier among the at least two device data corresponding to the second calculation rule.

4. The method according to claim 2, characterized in that: The method further comprises: When the traversal of at least two pieces of the device data in the domain to be calculated is completed, clearing the domain to be calculated; The second device data and other device data in the data group whose timestamp is after the timestamp of the second device data are moved to the to-be-calculated domain.

5. The method according to any one of claims 1 to 4, characterized in that: The edge gateway is provided with a timer; the method further comprises: When the timer times out, performing calculation on each device data in the domain to be calculated; After each calculation of each device data in the to-be-calculated domain is completed, the timer is reset.

6. The method according to any one of claims 1 to 4, characterized in that: The first Internet of Things device includes at least one data collection point, and the data identifier is used to indicate the data collection point corresponding to the device data.

7. A data processing device, characterized in that: The device comprises: A receiving module, configured to receive a data group sent by a first IoT device, wherein the data group includes at least one piece of device data; the device data has a data identifier and a timestamp; A traversal module, used for traversing at least one piece of the device data in the data group in the order of the timestamps from earliest to latest; an adding module, configured to add the first device data to the to-be-calculated domain when the first device data in the data group is traversed and there is no device data having the same data identifier and a different timestamp as the first device data in the to-be-calculated domain of the edge gateway; A calculation module, for, when traversing to the second device data in the data group and there is device data with the same data identifier and different timestamp as the second device data in the to-be-calculated domain of the edge gateway, traversing at least two of the device data in the to-be-calculated domain in the order of the timestamps from the last to the first; when traversing to the third device data in the to-be-calculated domain and the data identifier of the third device data corresponds to the first calculation rule, and there is no device data associated with the first calculation rule in the to-be-calculated domain, associating the first calculation rule with the third device data; when traversing to the third device data and the data identifier of the third device data corresponds to the first calculation rule, and there is device data associated with the first calculation rule in the to-be-calculated domain, ending the traversal of the third device data; when traversing to at least two of the device data in the to-be-calculated domain is ended, performing calculation on each device data in the to-be-calculated domain according to a preset calculation rule; the calculation rule contains the data identifiers of at least two of the device data.

8. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one computer instruction, and the at least one computer instruction is loaded and executed by the processor to implement the data processing method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer instruction, and the computer instruction is loaded and executed by a processor to implement the data processing method according to any one of claims 1 to 6.

10. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium; the computer instructions are read and executed by a processor of a computer device to implement the data processing method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Equipment data acquisition method and device based on cloud edge collaboration, equipment and medium

    CN115460251A

  • Photovoltaic operation and maintenance data processing method and device, equipment and storage medium

    CN115796842A

  • Data processing method, data acquisition device and system

    CN118473576A

  • Data acquisition method and system of intelligent computing edge gateway, medium and equipment

    CN118945166A