Device startup rate aggregation algorithm and system for cloud-edge joint computing

Through the device power-on rate summary algorithm of cloud-edge joint computing, the device power-on rate calculation error caused by interruption of edge-end and cloud connection is solved, real-time and accurate data processing and calculation are realized, and the efficiency and resource utilization of the algorithm are improved.

CN119003283BActive Publication Date: 2025-03-11NINGBO SHUYI GONGLIAN TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411459024.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-03-11
Estimated Expiration
2044-10-18

AI Technical Summary

Technical Problem

In the industrial Internet of Things, the network connection between the edge and the cloud is unstable or interrupted, resulting in errors in the calculation of the device's boot rate. The existing solutions have problems such as real-time data upload delay, high time-consuming data matching in business dimensions, and low algorithm efficiency.

Method used

The device power-on rate summary algorithm of cloud-edge joint computing is adopted. The edge end records offline data when the connection is interrupted, and returns the data to the cloud when the connection is restored. The cloud performs data recalculation and matching to ensure the accuracy and efficiency of the calculation.

Benefits of technology

It realizes fast and accurate joint summary calculation of real-time service dimension data after the edge-end connection is interrupted and restored at the edge-end connection and the device operating status change data saved offline by the edge-end, reducing the redundant data of the algorithm, improving the computing speed and memory usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003283B_ABST
    Figure CN119003283B_ABST
Patent Text Reader

Abstract

The present invention provides a device startup rate summary algorithm and system for cloud-edge joint computing. When the connection between the edge and the cloud is interrupted, the edge saves the device operation status change events during the offline period; when the connection between the edge and the cloud is restored, all data generated during the offline period are transmitted back to the cloud; the cloud receives the offline data reported by the edge, determines the recalculation start time and the recalculation end time according to the connection interruption time and the connection restoration time, rematches the business dimension change events between the recalculation start time and the recalculation end time with the device operation status change events, and recalculates the operation time and the total time; after the recalculation is completed, replaces the original corresponding data with the recalculated data; the advantage is that after the cloud-edge connection is interrupted and restored, the cloud and edge efficiently and collaboratively recalculate the offline data to obtain a device startup rate report that accurately matches the business dimension and has accurate and reliable results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of industrial Internet of Things report data processing, and in particular to an equipment startup rate summary algorithm and system for cloud-edge joint computing, which is good at processing the joint summary calculation of real-time business dimension data after the connection between the edge and the cloud is interrupted and restored, and the equipment operation status change data saved offline at the edge. Background Art

[0002] In the Industrial Internet of Things, the cloud is a remote server or data center, which is usually used to process and analyze large amounts of data collected from various devices and sensors. The edge is close to the physical location of the data source, such as the factory floor, machine equipment, or the direct connection point of the sensor. The edge device can perform tasks such as real-time monitoring, predictive maintenance, and anomaly detection. The cloud and edge usually work together to achieve more efficient data processing and decision support. The cloud provides strong background support, while the edge provides fast front-end response. This architecture helps optimize resource utilization, improve system reliability, and support more complex analysis and automation tasks.

[0003] For example, the cloud-edge collaborative industrial Internet of Things data acquisition and control system and heterogeneous device gateway disclosed in the invention patent publication text with application publication number CN116546013A are aimed at the problems of increasing data volume, higher real-time requirements and higher data security requirements in the growing Internet of Things, frequent device adaptation problems in Internet of Things development, and how to ensure the high availability, maintainability and scalability of the system. By introducing one or more edge terminals between the cloud and the device, and utilizing edge computing, part of the data and calculations are placed on the edge for processing, thereby reducing processing delays, alleviating pressure on the cloud, reducing development and operation costs and increasing efficiency.

[0004] In the actual application scenarios of the Industrial Internet of Things, edge devices such as acquisition terminals need to upload the collected production equipment data to the cloud, which will clean, summarize, calculate reports, and report to the database for storage. For example, the equipment startup rate is an important performance indicator in the Industrial Internet of Things. It reflects the ratio of the actual startup time of the equipment to the total time within a certain period of time, which is of great significance for measuring production efficiency, equipment utilization and production planning.

[0005] In the calculation of device startup rate, a common method is to collect and monitor the operating status of the device at the edge, and upload the status change information to the cloud when the device running / stopping status changes. For example:

[0006] At a certain moment, a device changes from a running state to a stopped state, and the edge reports the stopped state to the cloud; at a certain moment, a device changes from a stopped state to a running state, and the edge reports the running state to the cloud.

[0007] Within a period of time, the cloud calculates the total operating time of the device within that period based on the reported data, and the device startup rate within that period is .

[0008] Usually, since the edge is closer to the device, it often uses local wired connections such as data cables and sensors to connect to the device. The cloud is usually far away from the device and edge, and it often uses wireless connections such as the Internet and local area network to connect to the edge. Even if a wired connection is used, due to the long distance between the cloud and the edge, and the complex industrial production environment of the factory, the network connection between the edge and the cloud is often unstable or even disconnected. If one or several status change information cannot be correctly uploaded to the cloud due to disconnection, the equipment running time or stop time statistics will be incorrect, and errors will occur in the calculation of the equipment power-on rate. Typical examples include Figure 1 As shown in the figure, the device is actually in a stopped state during the BC segment, but due to the interruption of communication between the cloud and the edge, this period of time is mistakenly counted as a running state, resulting in the calculated value of the device power-on rate being greater than the actual correct value.

[0009] The conventional solution to the aforementioned data upload and statistical errors caused by unstable or interrupted connection between the edge and the cloud is as follows: when the edge is offline, the device status change information is temporarily cached in the local queue. After the connection is restored, the cached local queue data is uploaded first, and then the real-time upload is restored after the local queue data is uploaded. This data return method has at least the following technical problems:

[0010] First, due to the sequential upload, that is, uploading offline data first and then resuming real-time data upload, new real-time data may be generated during this period, which will cause a delay in real-time data upload.

[0011] Second, the cloud does not only process the device status change data uploaded by the edge, but also needs to process the business dimension data. When matching the offline data sent back by the edge with the business dimension data, in order to ensure data accuracy, it is necessary to match the offline data to the business dimension data generated at that time, rather than the latest business dimension data. Therefore, it is necessary to perform timestamp matching on each piece of data, which is quite time-consuming.

[0012] Third, each time edge data is received, it is necessary to match the business dimension according to the data time. Usually, the latest value of each business dimension data in the database before the data time is queried. During the query process, all data that meets the time conditions needs to be sorted and the maximum value is taken. Therefore, this algorithm is very inefficient.

[0013] One optimization solution is to mark each received data on the edge to distinguish real-time data from offline data, and the cloud matches the data based on the mark. However, when there is a lot of offline data, this calculation method still consumes a lot of time. Another optimization solution is to store business dimension data in memory to speed up calculations. The premise is that business dimensions are stored in memory for a long time, which will take up a large amount of memory space and have high maintenance costs.

[0014] Therefore, it is urgent to develop a device startup rate algorithm that can jointly calculate between the cloud and the edge, with reliable accuracy, less redundant data, fast calculation speed, and low memory usage, in order to solve the above technical problems. Summary of the invention

[0015] In view of the device power-on rate calculation errors caused by the connection interruption between the above-mentioned cloud and edge, as well as the problems existing in conventional offline data transmission and calculation methods, the technical problem to be solved by the present invention is to provide a device power-on rate summary algorithm and system for cloud-edge joint computing. Based on efficient collaborative joint computing between the cloud and the edge, when the communication interruption between the edge and the cloud is restored, the cloud receives the offline device status change data returned by the edge, and quickly and accurately matches it with the real-time business dimension data to obtain an accurate and reliable device power-on rate report. The algorithm has less redundant data, fast calculation speed and low memory usage.

[0016] The technical solution adopted by the present invention to solve the above technical problems is: a device startup rate summary algorithm for cloud-edge joint computing, - When the connection between the edge and the cloud is normal:

[0017] The edge receives a device operation status change event and reports the status before and after the change to the cloud in real time;

[0018] The cloud receives the business dimension change event and the device operation status change event reported by the edge, matches the latest business dimension and device operation status in real time, and calculates the operation time and total time; and saves the data of each match and calculation;

[0019] -When the connection between the edge and the cloud is interrupted:

[0020] The edge records the connection interruption time and the device status at that time, and saves the device operation status change events during the offline period;

[0021] -When the connection between the edge and the cloud is restored:

[0022] The edge records the connection recovery time and transmits all data generated during the offline period back to the cloud;

[0023] The cloud receives the data during the offline period reported by the edge, determines the recalculation start time and the recalculation end time according to the connection interruption time and the connection recovery time, rematches the business dimension change event between the recalculation start time and the recalculation end time with the device operation status change event in terms of business dimension and device operation status, and recalculates the operation time and the total time; after the recalculation is completed, replaces the original corresponding data with the recalculated data;

[0024] -Query the device startup rate:

[0025] The cloud receives an instruction to query the device startup rate, calculates the queried device startup rate=aggregate operation time / aggregate total time, and outputs the query result.

[0026] The preferred technical solution adopted by the present invention to solve the above technical problems is: - When the edge is connected to the cloud normally:

[0027] The edge receives the device operation status change event and reports it to the cloud in the format of device ID_event time_state before change-state after change;

[0028] The cloud creates and maintains a business dimension table, a power on / off change table, and a business dimension power on rate table;

[0029] The cloud receives the device operation status change event reported by the edge, and stores it in the power on / off change table in the format of device ID_event time_pre-change status-post-change status;

[0030] The cloud receives the business dimension change event and stores it in the business dimension table in the format of device ID_event time_business dimension type_changed dimension value;

[0031] Each time the cloud receives a business dimension change event or a device operating status change event, it updates the business dimension startup rate table to match the latest business dimension and device operating status in real time, calculates the operating time and the total time, and saves the data of each match and calculation in the business dimension startup rate table.

[0032] The preferred technical solution adopted by the present invention to solve the above technical problems is: the cloud updates the business dimension startup rate table in real time in the format of device ID_aggregate time dimension_operation status_business dimension_start time_end time_operation duration_total duration, specifically including the following steps:

[0033] Step S01: intercepting the summary time dimension part of the event time as the value of the summary time dimension;

[0034] Step S02: If the received data is a device operation state change event, the changed state is used as the operation state value; if the received data is a business dimension change event, the changed dimension value is used as the business dimension value;

[0035] Step S03: Fill the unupdated running status and business dimensions in the current data strip with the values ​​of the corresponding fields of the previous data strip;

[0036] Step S04: taking the event time as the start time of the current data strip;

[0037] Step S05: Use the event time as the end time of the previous data strip, and calculate the running time and total time of the previous data strip.

[0038] The preferred technical solution adopted by the present invention to solve the above technical problems is: - When the connection between the edge and the cloud is interrupted:

[0039] The edge creates and maintains an offline data table, and records the connection interruption time and the device status at that time in the format of device ID_event time_disconnection status, and stores it in the offline data table;

[0040] The edge receives the device operation status change event and stores it in the offline data table in the format of device ID_event time_state before change-state after change;

[0041] The operation mode of the cloud when the connection is maintained normally;

[0042] -When the connection between the edge and the cloud is restored:

[0043] The edge records the connection recovery time in the format of device ID_event time_recovery connection, stores it in the offline data table, and transmits the offline data table back to the cloud;

[0044] The edge and the cloud return to the data interaction mode when the connection is normal.

[0045] The preferred technical solution adopted by the present invention to solve the above technical problems is: - When the connection between the edge and the cloud is restored:

[0046] The cloud receives the offline data table reported by the edge, and recalculates the service dimension startup rate table, specifically including the following steps:

[0047] Step S10: Create a temporary recalculated business dimension startup rate table in the format of device ID_aggregated time dimension_operation status_business dimension_start time_end time_operation duration_total duration;

[0048] Step S20: extracting the equipment operation status change event data strips in the offline data table, and inserting them into the power on / off change table in chronological order;

[0049] Step S30: intercept and summarize the time dimension part of the connection interruption time in the offline data table, and set it as the recalculation start time; intercept and summarize the time dimension part of the connection recovery time in the offline data table, and set the next summarized time dimension as the recalculation end time;

[0050] Step S40: query the business dimension table and the power on / off change table, extract all business dimension change events and device operation status change events between the recalculation start time and the recalculation end time, and sort them by event time to form an offline event update queue;

[0051] Step S50: query the business dimension table, obtain the latest dimension value of each business dimension type before the recalculation start time, and set it as the value of the initial business dimension of the temporary recalculation business dimension startup rate table; set the pre-change state in the first device operation state change event after the recalculation start time as the value of the initial operation state of the temporary recalculation business dimension startup rate table; set the recalculation start time as the initial start time of the temporary recalculation business dimension startup rate table;

[0052] Step S60: for each data item in the offline update event queue, rematch the business dimension and the device operation status, recalculate the operation time and the total time, and store them in the temporary recalculated business dimension startup rate table;

[0053] Step S70: Replace all data items in the business dimension startup rate table within the range of the recalculation start time to the recalculation end time with the temporarily recalculated business dimension startup rate table that has been recalculated; clear the offline event update queue and the temporarily recalculated business dimension startup rate table.

[0054] The preferred technical solution adopted by the present invention to solve the above technical problem is: the step S60 specifically includes the following steps:

[0055] Step S61: intercepting the summary time dimension part of the event time in the queue data being processed as the value of the summary time dimension;

[0056] Step S62: for the device operation state change event in the offline update event queue, the changed state is used as the operation state value; for the business dimension change event in the offline update event queue, the changed dimension value is used as the business dimension value;

[0057] Step S63: Fill the unupdated operation status and business dimensions in the current data strip with the values ​​of the corresponding fields of the previous data strip;

[0058] Step S64: taking the event time in the queue data being processed as the start time of the current data strip;

[0059] Step S65: Use the event time in the queue data being processed as the end time of the previous data strip, and calculate the running time and total time of the previous data strip.

[0060] The preferred technical solution adopted by the present invention to solve the above technical problems is: - Query the device startup rate:

[0061] The cloud receives a device startup rate query instruction, and filters corresponding data items of the business dimension startup rate table according to the queried business dimension;

[0062] Sum the running time of the filtered data strips and output the summary running time; Sum the total time of the filtered data strips and output the summary total time;

[0063] Calculate the device power-on rate = aggregated running time / aggregated total time, and output the query result.

[0064] Another technical solution adopted by the present invention to solve the above technical problem is: a device startup rate summary system for cloud-edge joint computing, including the following system modules:

[0065] - The edge real-time module is used to receive the device operation status change events uploaded by the device in real time when the edge is connected to the cloud normally, and report the status before and after the change to the cloud real-time module;

[0066] - The edge offline module is used to record the time of the connection interruption and the device status at that time when the connection between the edge and the cloud is interrupted, and save the device operation status change events during the offline period; when the connection between the edge and the cloud is restored, it is used to record the connection restoration time and transmit all data generated during the offline period back to the cloud;

[0067] - A cloud-based real-time module is used to receive business dimension change events and device operation status change events reported by the edge, match the latest business dimension and device operation status in real time, and calculate the operation time and total time;

[0068] Used to store the data of each match and calculation into the data storage module;

[0069] Used to receive the device startup rate query instruction, calculate the queried device startup rate = summary operation time / summary total time, and output the query result;

[0070] - A cloud offline module, which is used to receive the data during the offline period reported by the edge when the connection between the edge and the cloud is restored, determine the recalculation start time and the recalculation end time according to the connection interruption time and the connection restoration time, rematch the business dimension change event and the device operation status change event between the recalculation start time and the recalculation end time in terms of business dimension and device operation status, and recalculate the operation time and total time;

[0071] Used to send the recalculated data to the data storage module after the recalculation is completed;

[0072] - A data storage module, used for receiving and storing the data of each match and calculation from the cloud real-time module;

[0073] Used to receive and store the recalculated data from the cloud offline module to replace the original corresponding data.

[0074] Another technical solution adopted by the present invention to solve the above-mentioned technical problem is: a computer device, including a memory and a processor, the memory storing a computer program, characterized in that when the processor executes the computer program, it implements the steps of the device startup rate summary algorithm of cloud-edge joint computing.

[0075] Another technical solution adopted by the present invention to solve the above-mentioned technical problem is: a computer program product, including a computer program, characterized in that when the computer program is executed by a processor, it implements the steps of a device startup rate summary algorithm for cloud-edge joint computing.

[0076] Compared with the prior art, the advantages of the present invention are: First, when the connection between the edge and the cloud is interrupted, the edge offline module continues to save the equipment operation status change data during the offline period, and reports it to the cloud for data recalculation after the connection is restored, giving full play to the advantages of cloud-edge joint computing in various emergency situations, and achieving the accuracy of equipment startup rate calculation in a complex industrial Internet of Things network environment.

[0077] Second, through the construction of edge offline / real-time modules and cloud offline / real-time modules, as well as the design of relative independence of offline / real-time data transmission, storage and calculation, the logical separation of offline / real-time data processing is achieved, eliminating the negative impact of offline data transmission and calculation on real-time data processing in the existing technology.

[0078] Third, the time of offline and reconnection is recorded through the edge offline module, and when the connection is restored, the device operating status during the offline period is synchronized and transmitted back to the cloud. After the cloud offline module recalculates the data during the offline period, it replaces the calculation method of the original data. Only a small amount of data query and retrieval operations are required to complete the data recalculation. There is no need to match the original data one by one. The algorithm redundancy is reduced to an extremely low level, the memory and processor usage is small, and the memory can be released in time. It is a very efficient offline data processing method.

[0079] Furthermore, by redetermining the recalculation start time and the recalculation end time, the omission of data bar recalculation can be further reduced, and the accuracy of the equipment power-on rate calculation results can be improved; by synchronously recording the status before and after the equipment operating status changes, the number and complexity of query operations can be further reduced, and the calculation efficiency can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] The present invention will be further described in detail below in conjunction with the accompanying drawings and preferred embodiments, but those skilled in the art will appreciate that these drawings are drawn only for the purpose of explaining the preferred embodiments and therefore should not be used as a limitation on the scope of the present invention. In addition, unless otherwise specified, the drawings are only schematically representing the composition or structure of the described objects and may contain exaggerated displays, and the drawings are not necessarily drawn to scale.

[0081] Figure 1 This is a diagram of the device startup rate calculation error caused by the cloud-edge communication interruption mentioned in the background technology;

[0082] Figure 2 This is a simplified structural diagram of the data transmission network of the Industrial Internet of Things;

[0083] Figure 3 A structural block diagram of a device startup rate summary system for cloud-edge joint computing according to a preferred embodiment of the present invention;

[0084] Figure 4 This is a flow chart of a device startup rate summary algorithm for cloud-edge joint computing in a preferred embodiment of the present invention when the edge is connected to the cloud normally;

[0085] Figure 5 This is a flow chart of a device startup rate aggregation algorithm for cloud-edge joint computing when the connection between the edge and the cloud is interrupted in a preferred embodiment of the present invention;

[0086] Figure 6 This is a flow chart of a device startup rate aggregation algorithm for cloud-edge joint computing when the connection between the edge and the cloud is restored in a preferred embodiment of the present invention;

[0087] Figure 7This is a flowchart of a device startup rate summary algorithm for cloud-edge joint computing when querying device startup rates in a preferred embodiment of the present invention. DETAILED DESCRIPTION

[0088] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0089] like Figure 2 The figure shows a simplified structural diagram of the data transmission network of the Industrial Internet of Things, in which the acquisition terminal is a typical edge device, which is usually configured close to the production equipment and uses a local wired connection with the production equipment, such as Ethernet, or field buses such as Profibus, DeviceNet, CAN, or serial communications such as RS-232, RS-485, or optical fiber communication, etc. Cloud devices usually refer to servers, which are usually configured far away from the production equipment and edge devices. They do not communicate directly with the production equipment, but communicate with the edge devices through wireless or wired connections, such as the Internet, factory LAN, etc.

[0090] In order to effectively solve the problems of unstable or interrupted network communication connection between edge and cloud in specific application scenarios of industrial Internet of Things, resulting in the cloud being unable to receive the equipment operation status data of production equipment in real time, completely and accurately, resulting in errors in the query and statistics of equipment start-up rate indicators, and errors in the matching between equipment operation status and business dimension data, resulting in inaccurate statistics of equipment start-up rate indicators in conditional filtering queries, etc., this embodiment provides an optimal equipment start-up rate summary algorithm and system for cloud-edge joint computing of the present invention.

[0091] like Figure 3 The figure shows a structural block diagram of the device startup rate aggregation system of the cloud-edge joint computing provided in this embodiment, including the following five system modules:

[0092] Module 1: Edge real-time module. This module is configured in the edge device and is used to receive the device operation status change events uploaded by the device in real time when the edge is connected to the cloud normally, and report the status before and after the change to the cloud real-time module.

[0093] Module 2: Edge offline module. This module is configured in the edge device to record the time of connection interruption and the device status at that time when the connection between the edge and the cloud is interrupted, and save the device operation status change events during the offline period; when the connection between the edge and the cloud is restored, it is used to record the connection recovery time and transmit all data generated during the offline period back to the cloud.

[0094] Module 3: Cloud real-time module. This module is configured in the cloud server and is used to receive business dimension change events and device operation status change events reported by the edge, match the latest business dimension and device operation status in real time, and calculate the operation time and total time. It is also used to store the data of each match and calculation into the data storage module. It is also used to receive the device startup rate query instruction and calculate the startup rate of the queried device. , and output the query results.

[0095] It should be noted here that regardless of whether the connection between the edge and the cloud is interrupted, the cloud real-time module does not interrupt its data reception, transmission and calculation. When the connection between the edge and the cloud is interrupted, the cloud real-time module cannot receive the device operation status change event reported by the edge, and it will assume that the device operation status has not changed, and continue to receive, save, match and calculate the business dimension change event.

[0096] Module 4: Cloud offline module. This module is configured in the cloud server and is used to receive the offline data reported by the edge when the connection between the edge and the cloud is restored, determine the recalculation start time and recalculation end time according to the connection interruption time and connection restoration time, rematch the business dimension change event between the recalculation start time and the recalculation end time with the device operation status change event, and recalculate the operation time and total time. It is also used to send the recalculated data to the data storage module after the recalculation is completed.

[0097] It should be noted here that the cloud offline module is a system module that is relatively independent of the cloud real-time module. It starts working when the connection between the edge and the cloud is restored after being interrupted, and its data reception, transmission and calculation do not affect the normal operation of the cloud real-time module. When the connection between the edge and the cloud is restored, the cloud offline module relatively independently performs its data recalculation work during the offline period, and the cloud real-time module does not stop its data reception, transmission and calculation. The two modules run in parallel and relatively independently.

[0098] Module 5: Data storage module. In this embodiment, this module is a database, which is used to receive and store data from the cloud real-time module, including but not limited to the data of each match and calculation. It is also used to receive and store data from the cloud offline module, including but not limited to the recalculated data to replace the original corresponding data. It is also used to support the cloud real-time module and the cloud offline module to read the data stored therein.

[0099] The following, in combination with the device power-on rate summary algorithm of the cloud-edge joint computing provided in this embodiment, further understands the working modes of each module of the device power-on rate summary system of the cloud-edge joint computing, as well as the data transmission and joint calculation methods between modules, so as to comprehensively and systematically explain the working principles of the device power-on rate summary algorithm and system of the cloud-edge joint computing provided in this embodiment.

[0100] like Figures 4 to 7 As shown, the device power-on rate summary algorithm for cloud-edge joint computing provided in this embodiment is mainly divided into four working scenarios: normal connection between edge and cloud, interruption of connection between edge and cloud, recovery of connection between edge and cloud, and query of device power-on rate.

[0101] like Figure 4 As shown in the figure, when the edge and cloud are connected normally, the edge receives the equipment operation status change event from the production equipment and reports the status before and after the change to the cloud in real time. The cloud receives the business dimension change event and the equipment operation status change event reported by the edge, matches the latest business dimension and equipment operation status in real time, and calculates the operation time and total time. After the matching and calculation are completed, the cloud saves the data of each matching and calculation.

[0102] The above algorithm is specifically executed by the edge real-time module and the cloud real-time module. The cloud real-time module processes, matches, and calculates the received data, and stores it in the data storage module. When subsequent calculations need to call data, they read and call from the data storage module.

[0103] In this embodiment, data interaction between the edge and the cloud, data matching and calculation in the cloud, and data storage are performed in the form of reports. Specifically, the cloud creates and maintains three reports: business dimension table, power on / off change table, and business dimension power on rate table. The three reports are stored in the data storage module.

[0104] Among them, the edge receives the device operation status change event and reports it to the cloud in the format of device ID_event time_state before change-state after change. The cloud receives the device operation status change event reported by the edge and stores it in the power on / off change table in the format of device ID_event time_state before change-state after change. For example, when the production equipment with device ID 1001 changes from shutdown state to running state at 2024-01-01 10:00, the edge reports the device operation status change event to the cloud in the following format:

[0105] - 1001 2024-01-01 10:00 Shutdown-Run;

[0106] After receiving the device operation status change event, the cloud stores the following data in the power on / off change table:

[0107] Device ID Event time Event Status 1001 2024-01-01 10:00 Stop-Run

[0108] Preferably, the data storage module also stores a device status mapping relationship table, which stores the mapping relationship between various device operation data and the two device operation states of "stop" and "run". In this embodiment, the relevant device data includes "processing", "manual", "automatic", "idling", "fault" and "debugging". The mapping relationship in the device status mapping relationship table is as follows:

[0109] Equipment operation data Processing, manual, automatic, idling Fault and debugging Equipment operating status run Downtime

[0110] When the edge starts, it first requests the cloud to obtain the device status mapping relationship. The cloud real-time module retrieves the device status mapping relationship table from the data storage module and sends it to the edge. The edge collects device operation data in real time and parses it into two device operation states: "shutdown" and "running" according to the acquired device status mapping relationship.

[0111] The cloud receives business dimension change events and stores them in the business dimension table in the format of device ID_event time_business dimension type_changed dimension value. For the sake of simplicity, in this embodiment, the types of business dimensions only include "shift" and "product". Among them, the values ​​of shift include "morning shift", "mid-shift" and "evening shift", and the values ​​of products include "product name C1" and "product name C2". In other embodiments, the types of business dimensions can further include "personnel", "plan", etc., and the value of the business dimension type "product" can further include more.

[0112] In addition, business dimension data is not obtained by the edge from the production equipment itself, but is usually obtained directly from the cloud to each business dimension functional module. A typical example is that the personnel dimension data can be obtained by the cloud from the employee clock-in module, and the shift dimension data can be obtained by the cloud from the scheduling management module. However, the data content still corresponds specifically to the production equipment, so the device ID data is obtained at the same time.

[0113] For example, if the business dimension of the production equipment with equipment ID 1001 at 2024-01-01 10:00 is: morning shift, product name C1, the cloud stores the following data in the business dimension table:

[0114] Device ID Event time Business Dimension Dimension value after change 1001 2024-01-01 10:00 Flights morning shift 1001 2024-01-01 10:00 product Product NameC1

[0115] Each time the cloud receives a business dimension change event or a device operating status change event, it updates the business dimension startup rate table to match the latest business dimension and device operating status in real time, calculates the operating time and total time, and saves the data of each match and calculation in the business dimension startup rate table.

[0116] Specifically in this embodiment, the cloud creates and updates the business dimension startup rate table in real time in the format of device ID_aggregate time dimension_operation status_business dimension_start time_end time_operation duration_total duration, which specifically includes the following steps:

[0117] Step S01: intercept the summary time dimension part of the event time as the value of the summary time dimension.

[0118] It is necessary to further explain step S01 that the time field in the system is usually stored in the form of a timestamp, which is a string of digital characters. For the convenience of display, this embodiment makes the timestamp accurate to the minute level (usually accurate to the second level, and the second level is omitted for ease of reading) and translates it into the form of "year-month-day hour and minute". The summary time dimension part of the event time is intercepted, that is, a column of "summary time dimension" field is specially set in the report. The summary time dimension can be a minute dimension, an hour dimension, a day dimension, etc., so as to facilitate the summary statistics of the data items with the same summary time dimension in the report.

[0119] In this embodiment, the summary time dimension is the hour dimension, that is, the timestamp is truncated to the hour dimension and saved under the "summary time dimension". Taking the hour dimension as the summary time dimension is the most appropriate from the perspective of multiple factors such as summary statistics frequency, output summary report granularity, processor power consumption and memory usage.

[0120] Step S02: If the received data is a device operating state change event, the changed state is used as the operating state value; if the received data is a business dimension change event, the changed dimension value is used as the business dimension value.

[0121] Step S03: Fill the unupdated running status and business dimensions in the current data strip with the values ​​of the corresponding fields of the previous data strip.

[0122] Step S04: Use the event time as the start time of the current data strip.

[0123] Step S05: Use the event time as the end time of the previous data strip, and calculate the running time and total time of the previous data strip.

[0124] Step S05 needs to be further expanded: determine whether the running status is running, if so, the total duration = end time - start time, running duration = total duration; if not, the total duration = end time - start time, running duration = 0.

[0125] For example, the operating status of the production equipment with equipment ID 1001 at 2024-01-01 10:00 is: running; the business dimension is: morning shift, and the product name is C1. Therefore, the initial data item of the business dimension startup rate table at 2024-01-01 10:00 is as follows:

[0126] Device ID Aggregate time dimension (hours) Running status Business Dimension (Shift) Business Dimension (Product) Start time End Time Run time (seconds) Total duration (seconds) 1001 2024-01-01 10 run morning shift Product NameC1 2024-01-0110:00

[0127] The edge receives a new device operation status change event at 2024-01-01 10:20 and reports it to the cloud in the following format: - 1001 2024-01-01 10:20 Running-Shutdown; the cloud determines that a new device operation status change event has been received and stores it in the power on / off change table as follows:

[0128] Device ID Event time Event Status 1001 2024-01-01 10:00 Stop-Run 1001 2024-01-01 10:20 Run-Stop

[0129] The cloud updates the business dimension startup rate table in real time, and the hour dimension is intercepted as 2024-01-01 10. The running status is taken as the changed status "shutdown". The business dimension data is not updated, so the "morning shift" and "product name C1" of the previous data strip are filled in the corresponding fields of the current data strip, and the event time 2024-01-01 10:20 is used as the start time of the current data strip and the end time of the previous data strip.

[0130] Then calculate the running time and total time of the previous data strip. Since the running status of the previous data strip is running, the total time = 10:20-10:00 = 1200 (s), running time = total time = 1200 (s). The new business dimension startup rate table is as follows:

[0131] Device ID Aggregate time dimension (hours) Running status Business Dimension (Shift) Business Dimension (Product) Start time End Time Run time (seconds) Total duration (seconds) 1001 2024-01-0110 run morning shift Product NameC1 2024-01-0110:00 2024-01-0110:20 1200 1200 1001 2024-01-0110 Downtime morning shift Product NameC1 2024-01-0110:20

[0132] For example, the cloud receives a new business dimension change event at 2024-01-01 10:40, and the product of the production equipment with device ID 1001 is changed to "Product Name C2". Then the cloud stores a new data in the business dimension table:

[0133] Device ID Event time Business Dimension Dimension value after change 1001 2024-01-01 10:00 Flights morning shift 1001 2024-01-01 10:00 product Product NameC1 1001 2024-01-01 10:40 product Product NameC2

[0134] The cloud updates the business dimension startup rate table in real time, and the hour dimension is intercepted as 2024-01-01 10. The business dimension (product) field takes the dimension value "Product Name C2" after the change. The operation status data and business dimension (shift) data are not updated, so the "downtime" and "morning shift" of the previous data strip are filled in the corresponding fields of the current data strip, and the event time 2024-01-01 10:40 is used as the start time of the current data strip and the end time of the previous data strip.

[0135] Then calculate the running time and total time of the previous data strip. Since the running status of the previous data strip is shutdown, the total time = 10:40-10:20 = 1200 (s), and the running time = 0. The new business dimension startup rate table is as follows:

[0136] Device ID Aggregate time dimension (hours) Running status Business Dimension (Shift) Business Dimension (Product) Start time End Time Run time (seconds) Total duration (seconds) 1001 2024-01-0110 run morning shift Product NameC1 2024-01-0110:00 2024-01-0110:20 1200 1200 1001 2024-01-0110 Downtime morning shift Product NameC1 2024-01-0110:20 2024-01-0110:40 0 1200 1001 2024-01-0110 Downtime morning shift Product NameC2 2024-01-0110:40

[0137] Furthermore, due to the introduction of the concept of "aggregate time dimension", in addition to updating the business dimension startup rate table when receiving device operation status change events and business dimension change events, the cloud real-time module also updates the business dimension startup rate table when the aggregate time dimension changes to the next dimension period. The specific steps are as follows:

[0138] Step S101: taking the new summary time dimension as the value of the summary time dimension;

[0139] Step S102: Fill the values ​​of the corresponding fields in the current data strip with the values ​​of the device ID, operating status, and business dimension of the previous data strip;

[0140] Step S103: taking the start time of the new summary time dimension as the start time of the current data strip;

[0141] Step S104: taking the start time of the new summary time dimension as the end time of the previous data strip, and calculating the running time and total time of the previous data strip.

[0142] The rules for calculating the running time and total time are the same as those described above and will not be repeated here.

[0143] For example, when the time comes to 2024-01-01 11:00, for this embodiment, since the summary time dimension is the hour dimension, the summary time dimension is changed to the next dimension period, so the business dimension startup rate table is updated as follows:

[0144] Device ID Aggregate time dimension (hours) Running status Business Dimension (Shift) Business Dimension (Product) Start time End Time Run time (seconds) Total duration (seconds) 1001 2024-01-0110 run morning shift Product NameC1 2024-01-0110:00 2024-01-0110:20 1200 1200 1001 2024-01-0110 Downtime morning shift Product NameC1 2024-01-0110:20 2024-01-0110:40 0 1200 1001 2024-01-0110 Downtime morning shift Product NameC2 2024-01-0110:40 2024-01-0111:00 0 1200 1001 2024-01-0111 Downtime morning shift Product NameC2 2024-01-0111:00

[0145] The device startup summary algorithm for cloud-edge joint computing when the connection between the edge and the cloud is normal is as described above.

[0146] like Figure 5 As shown in the figure, when the connection between the edge and the cloud is interrupted, the edge records the time of the connection interruption and the device status at that time, and saves the device operation status change events during the offline period.

[0147] The algorithm is specifically executed by the edge offline module. In this embodiment, the edge offline module is also implemented in the form of a report. Specifically, the edge creates and maintains an offline data table, and records the connection interruption time and the device status at that time in the format of device ID_event time_disconnection status, and stores it in the offline data table. The edge receives the device operation status change event and stores it in the offline data table in the format of device ID_event time_pre-change status-post-change status.

[0148] When the connection between the edge and the cloud is restored, the edge records the connection restoration time and transmits all data generated during the offline period back to the cloud.

[0149] The algorithm is specifically executed by the edge offline module in the form of a report. The edge records the connection recovery time in the format of device ID_event time_recovery state, stores it in the offline data table, and transmits the offline data table back to the cloud.

[0150] For example, at 2024-01-01 11:10, the connection between the edge and the cloud is interrupted. At this time, the edge real-time module stops working and the edge offline module starts. First, an offline data table is created and the connection interruption time and the device status at that time are recorded. Since the operating status of the production device with device ID 1001 is down at this time, the offline data table records the following:

[0151] Device ID Event time Event Status 1001 2024-01-01 11:10 Disconnection during downtime

[0152] The production equipment with device ID 1001 had two equipment operation status changes during the edge offline period. The first occurred at 2024-01-01 11:20, and the operation status changed from shutdown to operation. The second occurred at 2024-01-01 11:40, and the operation status changed from operation to shutdown. Therefore, the edge offline module updates the offline data table as follows:

[0153] Device ID Event time Event Status 1001 2024-01-01 11:10 Disconnection during downtime 1001 2024-01-01 11:20 Stop-Run 1001 2024-01-01 11:40 Run-Stop

[0154] At 2024-01-01 11:50, the connection between the edge and the cloud is restored. Since the operating status of the production device with device ID 1001 is down at this time, the edge offline module records the following in the offline data table:

[0155] Device ID Event time Event Status 1001 2024-01-01 11:10 Disconnection during downtime 1001 2024-01-01 11:20 Stop-Run 1001 2024-01-01 11:40 Run-Stop 1001 2024-01-01 11:50 Restore connection

[0156] Then, the edge offline module returns the above offline data table to the cloud offline module.

[0157] In addition, as Figure 5 As shown, when the connection between the edge and the cloud is interrupted, the cloud real-time module maintains the normal operation mode of the connection, that is, it normally receives business dimension change events, normally updates the business dimension startup rate table, and performs normal data interaction with the data storage module. When the connection between the edge and the cloud is restored, the edge and the cloud return to the data interaction mode when the connection is normal, that is, the edge real-time module and the cloud real-time module return to the device startup rate summary algorithm of the cloud-edge joint calculation when the edge and the cloud are connected normally, and the cloud offline module performs its recalculation work relatively independently of the cloud real-time module.

[0158] For example, the cloud receives a new business dimension change event at 2024-01-01 11:30, and the shift of the production equipment with equipment ID 1001 is changed to "mid-shift". Then the cloud stores a new data in the business dimension table:

[0159] Device ID Event time Business Dimension Dimension value after change 1001 2024-01-01 10:00 Flights morning shift 1001 2024-01-01 10:00 product Product NameC1 1001 2024-01-01 10:40 product Product NameC2 1001 2024-01-01 11:30 Flights Middle Class

[0160] The cloud updates the business dimension startup rate table in real time, and the hour dimension is intercepted as 2024-01-01 11. The business dimension (shift) field takes the dimension value "mid-shift" after the change. The operation status data and business dimension (shift) data are not updated, so the "shutdown" and "product name C2" of the previous data strip are filled in the corresponding fields of the current data strip, and the event time 2024-01-01 11:30 is used as the start time of the current data strip and the end time of the previous data strip.

[0161] Then calculate the running time and total time of the previous data strip. Since the running status of the previous data strip is shutdown, the total time = 11:30-11:00 = 1800 (s), and the running time = 0. The new business dimension startup rate table is as follows:

[0162] Device ID Aggregate time dimension (hours) Running status Business Dimension (Shift) Business Dimension (Product) Start time End Time Run time (seconds) Total duration (seconds) 1001 2024-01-01 10 run morning shift Product NameC1 2024-01-01 10:00 2024-01-01 10:20 1200 1200 1001 2024-01-01 10 Downtime morning shift Product NameC1 2024-01-01 10:20 2024-01-01 10:40 0 1200 1001 2024-01-01 10 Downtime morning shift Product NameC2 2024-01-01 10:40 2024-01-01 11:00 0 1200 1001 2024-01-01 11 Downtime morning shift Product NameC2 2024-01-01 11:00 2024-01-01 11:30 0 1800 1001 2024-01-01 11 Downtime Middle Class Product NameC2 2024-01-01 11:30

[0163] At 2024-01-01 11:50, when the connection between the edge and the cloud is restored, the operating status of the production equipment with device ID 1001 is changed from shutdown to operation. The edge real-time module receives the new equipment operation status change event and reports it to the cloud real-time module in the following format: - 1001 2024-01-01 11:50 Shutdown-Operation; the cloud real-time module determines that it has received the new equipment operation status change event and stores it in the power on / off change table as follows:

[0164] Device ID Event time Event Status 1001 2024-01-01 10:00 Stop-Run 1001 2024-01-01 10:20 Run-Stop 1001 2024-01-01 11:50 Stop-Run

[0165] The cloud updates the business dimension startup rate table in real time, and the hour dimension is intercepted as 2024-01-01 11. The running status is "running" after the change. The business dimension data is not updated, so the "mid-shift" and "product name C2" of the previous data strip are filled in the corresponding fields of the current data strip, and the event time 2024-01-01 11:50 is used as the start time of the current data strip and the end time of the previous data strip.

[0166] Then the running time and total time of the previous data strip are calculated. Since the running status of the previous data strip is shutdown, the total time = 11:50-11:30 = 1200 (s), and the running time = 0.

[0167] The cloud does not receive any new change events between 2024-01-01 11:50 and 2024-01-01 12:00. Therefore, when the time comes to 2024-01-01 12:00, the summary time dimension is changed to the next dimension period, and the business dimension startup rate table is updated according to the algorithm of step S101 to step S104, so that the new business dimension startup rate table is obtained as follows:

[0168] Device ID Aggregate time dimension (hours) Running status Business Dimension (Shift) Business Dimension (Product) Start time End Time Run time (seconds) Total duration (seconds) 1001 2024-01-01 10 run morning shift Product NameC1 2024-01-01 10:00 2024-01-01 10:20 1200 1200 1001 2024-01-01 10 Downtime morning shift Product NameC1 2024-01-01 10:20 2024-01-01 10:40 0 1200 1001 2024-01-01 10 Downtime morning shift Product NameC2 2024-01-01 10:40 2024-01-01 11:00 0 1200 1001 2024-01-01 11 Downtime morning shift Product NameC2 2024-01-01 11:00 2024-01-01 11:30 0 1800 1001 2024-01-01 11 Downtime Middle Class Product NameC2 2024-01-01 11:30 2024-01-01 11:50 0 1200 1001 2024-01-01 11 run Middle Class Product NameC2 2024-01-01 11:50 2024-01-01 12:00 0 600 1001 2024-01-01 12 run Middle Class Product NameC2 2024-01-01 12:00

[0169] It can be seen that during the period from 2024-01-01 11:10 to 2024-01-01 11:50, the edge was disconnected from the cloud. During the offline period, the production device with device ID 1001 actually changed its device operating status twice at 11:20 and 11:40, but the two device operating status change events were only saved in the edge offline module and were not reported to the cloud. For the cloud, the device operating status is considered unchanged, and it keeps receiving business dimension change events and updating the business dimension startup rate table.

[0170] In particular, it was noted that at 11:50, two events occurred simultaneously: the connection between the edge and the cloud was restored, and the cloud received the device status change event reported by the edge. At this time, the edge offline module reported the offline data table to the cloud offline module, and the cloud offline module started its recalculation work, but it did not affect the cloud real-time module's reception of the device operation status change event and normal update of the business dimension startup rate table.

[0171] This dual-track parallel and non-interfering operation mode does not require real-time data calculation to wait for offline data recalculation, nor does it cause event queue waiting stagnation, data reporting delays, real-time data calculation delays, and other situations that affect the efficiency of the algorithm. The data reports generated by cloud-edge joint computing are accurate, and the probability of errors in the calculated device startup rate is extremely low, fully demonstrating the efficient, fast, delay-free and error-free functional effects brought by cloud-edge joint computing.

[0172] like Figure 6 As shown in the figure, the following focuses on the algorithm process of the cloud recalculating the data during the offline period after the connection between the edge and the cloud is restored:

[0173] First, the cloud receives the data during the offline period reported by the edge. In this embodiment, the cloud receives the offline data table of the edge through an http request, determines the recalculation start time and the recalculation end time according to the connection interruption time and the connection recovery time in the offline data table, and rematches the business dimension change event between the recalculation start time and the recalculation end time with the device operation status change event, and recalculates the operation time and the total time. After the recalculation is completed, the original corresponding data is replaced with the recalculated data.

[0174] The above algorithm is specifically executed by the cloud offline module. Since the business dimension table, power on / off change table, and business dimension power on rate table are stored in the data storage module, the cloud offline module will call relevant reports and data from the data storage module. The part of the business dimension power on rate table that has been recalculated will be sent to the data storage module to replace and correct the corresponding content in the business dimension power on rate table in the data storage module.

[0175] In this embodiment, the recalculation work of the cloud offline module is also performed in the form of a report. Specifically, the cloud receives the offline data table reported by the edge and recalculates the business dimension startup rate table, which specifically includes the following steps:

[0176] Step S10: Create a temporary recalculated business dimension startup rate table in the format of device ID_aggregated time dimension_operation status_business dimension_start time_end time_operation duration_total duration.

[0177] It can be seen that the format of the temporary recalculated business dimension startup rate table is the same as that of the business dimension startup rate table, which makes it convenient to directly replace the corresponding part of the data strips of the original business dimension startup rate table with the temporary recalculated business dimension startup rate table after the recalculation is completed.

[0178] Preferably, before executing step S10, the cloud offline module first determines whether there is a device operation status change event data bar in the offline data table. If there is no device operation status change event data bar at all, it means that no device operation status change occurred during the interruption of the connection between the edge and the cloud, and there is no need to recalculate the business dimension startup rate table, that is, there is no need to execute steps S10 to S70. However, in actual industrial Internet of Things application scenarios, due to the large number of production equipment, this situation is usually rare.

[0179] Step S20: extracting the equipment operation status change event data strips in the offline data table, and inserting them into the power on / off change table in chronological order.

[0180] For example, in this embodiment, when this step is performed, the cloud offline module retrieves the current power on / off change table from the data storage module, and inserts the second and third rows of data in the offline data table into the third and fourth rows of the power on / off change table in chronological order. The new power on / off change table is as follows (* indicates a newly inserted row):

[0181] Device ID Event time Event Status 1001 2024-01-01 10:00 Stop-Run 1001 2024-01-01 10:20 Run-Stop *1001 2024-01-01 11:20 Stop-Run *1001 2024-01-01 11:40 Run-Stop 1001 2024-01-01 11:50 Stop-Run

[0182] Step S30: The connection interruption time in the offline data table is intercepted and summarized as the time dimension part, and set as the recalculation start time; the connection recovery time in the offline data table is intercepted and summarized as the time dimension part, and the next summarized time dimension is set as the recalculation end time.

[0183] For example, in this embodiment, the connection interruption time in the offline data table is 2024-01-01 11:10, and the intercepted summary time dimension, that is, the hour dimension part, is 2024-01-01 11, so the recalculation start time is determined to be 2024-01-01 11:00. The connection recovery time in the offline data table is 2024-01-01 11:50, and the intercepted summary time dimension, that is, the hour dimension part, is 2024-01-01 11, and its next summary time dimension is 2024-01-01 12, so the recalculation end time is determined to be 2024-01-01 12:00.

[0184] Step S40: query the business dimension table and the power on / off change table, extract all business dimension change events and equipment operation status change events between the recalculation start time and the recalculation end time, and sort them by event time to form an offline event update queue.

[0185] For example, in this implementation, the cloud offline module requests the data storage module to retrieve all the times of the business dimension table and the power on / off change table between the recalculation start time 2024-01-01 11:00 and the recalculation end time 2024-01-01 12:00 (not included), and forms an offline time update queue by event time as follows:

[0186] - 1001 2024-01-01 11:20 Shutdown-Run;

[0187] - 1001 2024-01-01 11:30 Middle shift;

[0188] - 1001 2024-01-01 11:40 Run-Shutdown;

[0189] - 1001 2024-01-01 11:50 Shutdown-Run.

[0190] Step S50: query the business dimension table, obtain the latest dimension value of each business dimension type before the recalculation start time, and set it as the initial business dimension value of the temporary recalculation business dimension startup rate table; set the pre-change state in the first equipment operation state change event after the recalculation start time as the initial operation state value of the temporary recalculation business dimension startup rate table; set the recalculation start time as the initial start time of the temporary recalculation business dimension startup rate table.

[0191] This step S50 is a process of determining the initial data item of the first row of the temporary recalculated business dimension startup rate table. For example, in this embodiment, the cloud offline module requests the data storage module to retrieve data, and the latest dimension value of each business dimension type in the business dimension table before the recalculation start time 2024-01-01 11:00 is: business dimension (shift) is "morning shift", business dimension (product) is "product name C2", which is used as the initial value of the corresponding field of the temporary recalculated business dimension startup rate table.

[0192] The first equipment operation status change event in the power on / off change table after the recalculation start time 2024-01-01 11:00 has a pre-change status of "downtime". Therefore, the initial data of the first row of the temporary recalculation business dimension power on rate table is as follows:

[0193] Device ID Aggregate time dimension (hours) Running status Business Dimension (Shift) Business Dimension (Product) Start time End Time Run time (seconds) Total duration (seconds) 1001 2024-01-01 11 Downtime morning shift Product NameC2 2024-01-01 11:00

[0194] What needs to be further pointed out about step S50 is that it should be noted that, unlike obtaining the initial business dimension value, the initial operating status value is the first device operating status change event after the recalculation start time, and only the state before the change is used. Since the device operating status change event has been obtained in step S40, step S50 does not need to re-query the power on / off change table, nor does it need to trace back the data before the recalculation start time. This is because when recording the device operating status change event, the status before and after the device operating status change is recorded in the format of "state before change - state after change", so when querying, there is no need to trace back the data before the query time point, and only part of the data content after the query time point needs to be directly extracted, thereby effectively improving the query and calculation efficiency.

[0195] Step S60: for each data item in the offline update event queue, rematch the business dimension and the device operation status, recalculate the operation time and the total time, and store them in the temporary recalculated business dimension startup rate table.

[0196] This step S60 is a process of recalculating the data between the recalculation start time and the recalculation end time. Further, it specifically includes the following steps:

[0197] Step S61: intercepting the summary time dimension portion of the event time in the queue data being processed as the value of the summary time dimension.

[0198] Step S62: For the device operation status change event in the offline update event queue, the changed state is used as the operation status value; for the business dimension change event in the offline update event queue, the changed dimension value is used as the business dimension value.

[0199] Step S63: Fill the unupdated running status and business dimensions in the current data strip with the values ​​of the corresponding fields of the previous data strip.

[0200] Step S64: Use the event time in the queue data being processed as the start time of the current data strip.

[0201] Step S65: Use the event time in the queue data being processed as the end time of the previous data strip, and calculate the running time and total time of the previous data strip.

[0202] Since in this embodiment, when the summary time dimension changes to the next dimension period, the cloud real-time module will update the business dimension startup rate table with the algorithm of step S101 to step S104, to match it, the cloud offline module needs to execute a similar algorithm to ensure the data integrity of the temporary recalculation business dimension startup rate table. Therefore, it is further preferred that step S65 also includes step S66: using the recalculation end time as the end time of the last data item of the temporary recalculation business dimension startup rate table, and calculating the running time and the total time.

[0203] It can be seen that the algorithm of steps S61 to S65 is similar to the algorithm of steps S01 to S05 for real-time update of the business dimension startup rate table by the cloud real-time module when the edge and cloud are connected normally. The difference is that when the edge and cloud are connected normally, the business dimension change events and device operation status change events are received by the cloud real-time module from time to time, and the cloud real-time module calculates and updates the business dimension startup rate table in real time. During the data recalculation process, the offline update event queue is determined at the start of the recalculation, and the data is pushed sequentially to the cloud offline module in the form of a queue, so that the data recalculation can be completed efficiently, quickly, and without delay.

[0204] Therefore, the aforementioned data recalculation process will not be described in detail step by step here. For this embodiment, after step S61 to step S66 are executed, the temporary recalculated business dimension startup rate table is obtained as follows:

[0205] Device ID Aggregate time dimension (hours) Running status Business Dimension (Shift) Business Dimension (Product) Start time End Time Run time (seconds) Total duration (seconds) 1001 2024-01-01 11 Downtime morning shift Product NameC2 2024-01-01 11:00 2024-01-01 11:20 0 1200 1001 2024-01-01 11 run morning shift Product NameC2 2024-01-01 11:20 2024-01-01 11:30 600 600 1001 2024-01-01 11 run Middle Class Product NameC2 2024-01-01 11:30 2024-01-01 11:40 600 600 1001 2024-01-01 11 Downtime Middle Class Product NameC2 2024-01-01 11:40 2024-01-01 11:50 0 600 1001 2024-01-01 11 run Middle Class Product NameC2 2024-01-01 11:50 2024-01-01 12:00 600 600 1001 2024-01-01 12 run Middle Class Product NameC2 2024-01-01 12:00

[0206] It can be seen that after the cloud offline module receives the offline period data reported by the edge offline module and before the data recalculation officially starts, it is necessary to first determine the recalculation start time and the recalculation end time based on the connection interruption time and the connection recovery time, rather than directly recalculating the data between the connection interruption time and the connection recovery time. In addition, according to the recalculation start time and the recalculation end time determined by the rules of step S30, the recalculation time span is greater than the offline time span and is equal to an integer multiple of the summary time dimension.

[0207] The first advantage of this algorithm for recalculating time is that it can effectively avoid omission of recalculated data. This embodiment is a typical example of causing omission of recalculated data. It can be seen intuitively that if the data between the connection interruption time and the connection restoration time is directly recalculated, the device operation status change event at 2024-01-01 11:50 will inevitably be omitted, resulting in the total duration as the denominator of the device startup rate calculation being too small and the calculated value of the device startup rate being too large.

[0208] The second advantage of this algorithm for recalculating time is reflected in the following step S70.

[0209] Step S70: Replace all data items in the business dimension startup rate table within the range of the recalculation start time to the recalculation end time with the temporarily recalculated business dimension startup rate table that has been recalculated; clear the offline event update queue and the temporarily recalculated business dimension startup rate table.

[0210] In this step S70, the cloud offline module sends the recalculated temporary recalculated business dimension startup rate table to the data storage module, and the data storage module replaces the data of the original business dimension startup rate table with the recalculated temporary recalculated business dimension startup rate table. Since the recalculation time span is equal to an integer multiple of the summary time dimension, when identifying and locating the data strips to be replaced, it is only necessary to match the "summary time dimension" field and replace the data strips in batches in units of the summary time dimension. The entire process of identification, positioning, and replacement is quite simple and fast. For example, in this embodiment, it is only necessary to replace the data strips with the hour dimension of 2024-01-01 11 in batches.

[0211] On the contrary, if this algorithm for recalculating time is not used, when identifying and locating the data strips to be replaced, the only way is to search for the start time and end time one by one for identification. However, the original business dimension startup rate table does not have data strips with start times of 2024-01-01 11:20 and 2024-01-01 11:40. It is necessary to design additional judgment statements and identification rules, which will inevitably increase redundant statements and additional algorithms, resulting in reduced computing efficiency and increased memory usage. However, this algorithm design for recalculating time completely avoids this situation.

[0212] Therefore, in this embodiment, the correct business dimension startup rate table that is finally saved in the data storage module after recalculation and replacement is as follows:

[0213] Device ID Aggregate time dimension (hours) Running status Business Dimension (Shift) Business Dimension (Product) Start time End Time Run time (seconds) Total duration (seconds) 1001 2024-01-01 10 run morning shift Product NameC1 2024-01-01 10:00 2024-01-01 10:20 1200 1200 1001 2024-01-01 10 Downtime morning shift Product NameC1 2024-01-01 10:20 2024-01-01 10:40 0 1200 1001 2024-01-01 10 Downtime morning shift Product NameC2 2024-01-01 10:40 2024-01-01 11:00 0 1200 1001 2024-01-01 11 Downtime morning shift Product NameC2 2024-01-01 11:00 2024-01-01 11:20 0 1200 1001 2024-01-01 11 run morning shift Product NameC2 2024-01-01 11:20 2024-01-01 11:30 600 600 1001 2024-01-01 11 run Middle Class Product NameC2 2024-01-01 11:30 2024-01-01 11:40 600 600 1001 2024-01-01 11 Downtime Middle Class Product NameC2 2024-01-01 11:40 2024-01-01 11:50 0 600 1001 2024-01-01 11 run Middle Class Product NameC2 2024-01-01 11:50 2024-01-01 12:00 600 600 1001 2024-01-01 12 run Middle Class Product NameC2 2024-01-01 12:00

[0214] Furthermore, in this step S70, after the cloud offline module sends the offline event update queue and the temporary recalculation business dimension startup rate table to the data storage module, the two tables are cleared to fully release the memory for the next connection interruption. This frees up more computing power and storage space for real-time data transmission, calculation and storage, improves real-time computing efficiency, and effectively reduces power consumption.

[0215] like Figure 7 As shown, when querying the device startup rate, the cloud receives the query device startup rate instruction and calculates the queried device startup rate , and output the query results.

[0216] Specifically in this embodiment, the cloud receives a device startup rate query instruction, filters the corresponding data strips of the business dimension startup rate table according to the queried business dimension; sums the running time of the filtered data strips, and outputs the summary running time; sums the total time of the filtered data strips, and outputs the summary total time; calculates the startup rate of the queried device , and output the query results.

[0217] Furthermore, after filtering the corresponding data strips of the business dimension startup rate table according to the queried business dimension, determine whether the end time of the last data strip filtered out is empty; if so, use the current time as the end time of the last data strip, and calculate the running time and total time of the last data strip.

[0218] For example, the cloud receives the following device startup rate query instruction at 2024-01-01 12:15: "Query the startup rate of the production equipment with device ID 1001 from 2024-01-01 11:00 to the present, with product name C2." The cloud real-time module then selects the following data items (with *) from the business dimension startup rate table of the data storage module:

[0219] Device ID Aggregate time dimension (hours) Running status Business Dimension (Shift) Business Dimension (Product) Start time End Time Run time (seconds) Total duration (seconds) 1001 2024-01-01 10 run morning shift Product NameC1 2024-01-01 10:00 2024-01-01 10:20 1200 1200 1001 2024-01-01 10 Downtime morning shift Product NameC1 2024-01-01 10:20 2024-01-01 10:40 0 1200 1001 2024-01-01 10 Downtime morning shift Product NameC2 2024-01-01 10:40 2024-01-01 11:00 0 1200 *1001 2024-01-01 11 Downtime morning shift Product NameC2 2024-01-01 11:00 2024-01-01 11:20 0 1200 *1001 2024-01-01 11 run morning shift Product NameC2 2024-01-01 11:20 2024-01-01 11:30 600 600 *1001 2024-01-01 11 run Middle Class Product NameC2 2024-01-01 11:30 2024-01-01 11:40 600 600 *1001 2024-01-01 11 Downtime Middle Class Product NameC2 2024-01-01 11:40 2024-01-01 11:50 0 600 *1001 2024-01-01 11 run Middle Class Product NameC2 2024-01-01 11:50 2024-01-01 12:00 600 600 *1001 2024-01-01 12 run Middle Class Product NameC2 2024-01-01 12:00

[0220] Since the end time of the last data strip selected is empty, the current time 2024-01-01 12:15 is used as the end time of the last data strip, and the running time and total time of the last data strip are calculated, and the data strips to be summarized and calculated are obtained as follows:

[0221] Device ID Aggregate time dimension (hours) Running status Business Dimension (Shift) Business Dimension (Product) Start time End Time Run time (seconds) Total duration (seconds) 1001 2024-01-01 11 Downtime morning shift Product NameC2 2024-01-01 11:00 2024-01-01 11:20 0 1200 1001 2024-01-01 11 run morning shift Product NameC2 2024-01-01 11:20 2024-01-01 11:30 600 600 1001 2024-01-01 11 run Middle Class Product NameC2 2024-01-01 11:30 2024-01-01 11:40 600 600 1001 2024-01-01 11 Downtime Middle Class Product NameC2 2024-01-01 11:40 2024-01-01 11:50 0 600 1001 2024-01-01 11 run Middle Class Product NameC2 2024-01-01 11:50 2024-01-01 12:00 600 600 1001 2024-01-01 12 run Middle Class Product NameC2 2024-01-01 12:00 2024-01-01 12:15 900 900

[0222] Calculate and output the summary running time = (0+600+600+0+600+900) = 2700 (S), calculate and output the summary total time = (1200+600+600+600+600+900) = 4500 (S), calculate the startup rate of the queried device , output the query result 60.00%.

[0223] In addition, the present invention also relates to a computer device, including a memory and a processor, the memory storing a computer program, and when the processor executes the computer program, the steps of the device startup rate summary algorithm of cloud-edge joint computing are implemented. It also relates to a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by the processor, the steps of the device startup rate summary algorithm of cloud-edge joint computing are implemented. It also relates to a computer program product, including a computer program, which, when executed by the processor, implements the steps of the device startup rate summary algorithm of cloud-edge joint computing.

[0224] It should be understood that, for the sake of ease of explanation and understanding, this embodiment only takes one device and two business dimension types as an example for illustration. In actual application scenarios, there are many devices connected to the industrial Internet of Things, and there are more types of business dimensions and business dimension values ​​contained in each type, and the situation will be more complicated. Therefore, the device startup rate aggregation algorithm and system for cloud-edge joint computing provided by the present invention will process a larger and more complex amount of messages when actually put into use.

[0225] In summary, the device startup rate aggregation algorithm and system for cloud-edge joint computing provided by the present invention can at least achieve the following technical effects:

[0226] First, when the connection between the edge and the cloud is interrupted, the edge offline module continues to save the equipment operation status change data during the offline period, and reports it to the cloud for data recalculation after the connection is restored, giving full play to the advantages of cloud-edge joint computing in various emergency situations, and achieving the accuracy of equipment startup rate calculation in complex industrial Internet of Things network environments.

[0227] Second, through the construction of edge offline / real-time modules and cloud offline / real-time modules, as well as the design of relative independence of offline / real-time data transmission, storage and calculation, the logical separation of offline / real-time data processing is achieved, eliminating the negative impact of offline data transmission and calculation on real-time data processing in the existing technology.

[0228] Third, the time of offline and reconnection is recorded through the edge offline module, and when the connection is restored, the device operating status during the offline period is synchronized and transmitted back to the cloud. After the cloud offline module recalculates the data during the offline period, it replaces the calculation method of the original data. Only a small amount of data query and retrieval operations are required to complete the data recalculation. There is no need to match the original data one by one. The algorithm redundancy is reduced to an extremely low level, the memory and processor usage is small, and the memory can be released in time. It is a very efficient offline data processing method.

[0229] Furthermore, by redetermining the recalculation start time and the recalculation end time, the omission of data bar recalculation can be further reduced, and the accuracy of the equipment power-on rate calculation results can be improved; by synchronously recording the status before and after the equipment operating status changes, the number and complexity of query operations can be further reduced, and the calculation efficiency can be improved.

[0230] It should be noted that like reference numerals denote similar items in the following drawings, and thus, once an item is defined in one drawing, it may not be further defined or explained in subsequent drawings.

[0231] The above is an introduction to the device startup rate aggregation algorithm and system for cloud-edge joint computing provided by the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the present invention and its core ideas. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, the present invention can also be improved and modified in a number of ways, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

Claims

1. The device startup rate aggregation algorithm of cloud-edge joint computing is characterized by: -When the edge and cloud are connected normally: The edge receives a device operation status change event and reports the status before and after the change to the cloud in real time; The cloud creates and maintains a business dimension table, a power on / off change table, and a business dimension power on rate table; The cloud receives the business dimension change event and stores it in the business dimension table, receives the device operation status change event reported by the edge and stores it in the power on / off change table; Each time the cloud receives a business dimension change event or a device operating status change event, the cloud updates the business dimension startup rate table to match the latest business dimension and device operating status in real time, calculates the operating time and the total time, and saves the data of each match and calculation in the business dimension startup rate table; -When the connection between the edge and the cloud is interrupted: The edge creates and maintains an offline data table, records the connection interruption time and the device status at that time, and saves the device operation status change events during the offline period to the offline data table; -When the connection between the edge and the cloud is restored: The edge records the connection recovery time, stores it in the offline data table, and transmits the offline data table back to the cloud; The cloud receives the offline data table reported by the edge, and recalculates the service dimension startup rate table, specifically including the following steps: Step S10: Create a temporary recalculated business dimension startup rate table in the format of device ID_aggregated time dimension_operation status_business dimension_start time_end time_operation duration_total duration; Step S20: extracting the equipment operation status change event data strips in the offline data table, and inserting them into the power on / off change table in chronological order; Step S30: intercept and summarize the time dimension part of the connection interruption time in the offline data table and set it as the recalculation start time; intercept and summarize the time dimension part of the connection recovery time in the offline data table and set its next summarized time dimension as the recalculation end time; Step S40: query the business dimension table and the power on / off change table, extract all business dimension change events and equipment operation status change events between the recalculation start time and the recalculation end time, and sort them by event time to form an offline event update queue; Step S50: query the business dimension table, obtain the latest dimension value of each business dimension type before the recalculation start time, and set it as the value of the initial business dimension of the temporary recalculation business dimension startup rate table; set the pre-change state in the first device operation state change event after the recalculation start time as the value of the initial operation state of the temporary recalculation business dimension startup rate table; set the recalculation start time as the initial start time of the temporary recalculation business dimension startup rate table; Step S60: for each data item in the offline update event queue, rematch the business dimension and the device operation status, recalculate the operation time and the total time, and store them in the temporary recalculated business dimension startup rate table; Step S70: replace all data items in the business dimension startup rate table within the range of the recalculation start time to the recalculation end time with the temporarily recalculated business dimension startup rate table that has been recalculated; clear the offline event update queue and the temporarily recalculated business dimension startup rate table; The step S60 specifically includes the following steps: Step S61: intercepting the summary time dimension part of the event time in the queue data being processed as the value of the summary time dimension; Step S62: for the device operation state change event in the offline update event queue, the changed state is used as the operation state value; for the business dimension change event in the offline update event queue, the changed dimension value is used as the business dimension value; Step S63: Fill the unupdated operation status and business dimensions in the current data strip with the values ​​of the corresponding fields of the previous data strip; Step S64: taking the event time in the queue data being processed as the start time of the current data strip; Step S65: taking the event time in the queue data being processed as the end time of the previous data strip, and calculating the running time and total time of the previous data strip; -Query the device startup rate: The cloud receives a device startup rate query instruction and calculates the startup rate of the queried device = , and output the query results.

2. According to the device startup rate aggregation algorithm of cloud-edge joint computing in claim 1, it is characterized by: -When the edge and cloud are connected normally: The edge receives the device operation status change event and reports it to the cloud in the format of device ID_event time_state before change-state after change; The cloud receives the device operation status change event reported by the edge, and stores it in the power on / off change table in the format of device ID_event time_pre-change status-post-change status; The cloud receives the business dimension change event and stores it in the business dimension table in the format of device ID_event time_business dimension type_changed dimension value.

3. The device startup rate aggregation algorithm of cloud-edge joint computing according to claim 2 is characterized by: The cloud updates the service dimension startup rate table in real time in the format of device ID_aggregate time dimension_operation status_service dimension_start time_end time_operation duration_total duration, specifically including the following steps: Step S01: intercepting the summary time dimension part of the event time as the value of the summary time dimension; Step S02: If the received data is a device operation state change event, the changed state is used as the operation state value; if the received data is a business dimension change event, the changed dimension value is used as the business dimension value; Step S03: Fill the unupdated running status and business dimensions in the current data strip with the values ​​of the corresponding fields of the previous data strip; Step S04: taking the event time as the start time of the current data strip; Step S05: Use the event time as the end time of the previous data strip, and calculate the running time and total time of the previous data strip.

4. The device startup rate aggregation algorithm for cloud-edge joint computing according to claim 2 is characterized by: -When the connection between the edge and the cloud is interrupted: The edge records the connection interruption time and the device status at that time in the format of device ID_event time_disconnection status, and stores it in the offline data table; The edge receives the device operation status change event and stores it in the offline data table in the format of device ID_event time_state before change-state after change; The operation mode of the cloud when the connection is maintained normally; -When the connection between the edge and the cloud is restored: The edge records the connection recovery time in the format of device ID_event time_recovery connection, stores it in the offline data table, and transmits the offline data table back to the cloud; The edge and the cloud return to the data interaction mode when the connection is normal.

5. The device startup rate aggregation algorithm for cloud-edge joint computing according to claim 2 is characterized by: -Query the device startup rate: The cloud receives a device startup rate query instruction, and filters corresponding data items of the business dimension startup rate table according to the queried business dimension; Sum the running time of the filtered data strips and output the summary running time; Sum the total duration of the filtered data strips and output the total duration; Calculate the startup rate of the device being queried = , and output the query results.

6. The device startup rate summary system of cloud-edge joint computing is characterized by: Includes the following system modules: - The edge real-time module is used to receive the device operation status change events uploaded by the device in real time when the edge is connected to the cloud normally, and report the status before and after the change to the cloud real-time module; -Edge offline module, which is used to create and maintain offline data tables when the connection between the edge and the cloud is interrupted, record the time of connection interruption and the device status at that time, and save the device operation status change events during the offline period to the offline data table; When the connection between the edge and the cloud is restored, the connection restoration time is recorded, stored in the offline data table, and the offline data table is transmitted back to the cloud; -Cloud real-time module, used to create and maintain business dimension table, power on / off change table, and business dimension power on rate table; Used to receive business dimension change events and store them in the business dimension table, receive equipment operation status change events reported by the edge and store them in the power on / off change table; Each time a business dimension change event or a device operating status change event is received, the latest business dimension and device operating status are matched in real time by updating the business dimension startup rate table, the operating time and the total time are calculated, and the data of each match and calculation is saved in the business dimension startup rate table; Used to store the data of each match and calculation into the data storage module; Used to receive the command to query the device power-on rate, and calculate the queried device power-on rate = , and output the query results; - A cloud offline module is used to receive the offline data table reported by the edge when the connection between the edge and the cloud is restored, and to recalculate the business dimension startup rate table: create a temporary recalculated business dimension startup rate table in the format of device ID_aggregate time dimension_operating status_business dimension_start time_end time_operating duration_total duration; Extract the equipment operation status change event data strips from the offline data table, and insert them into the power on / off change table in chronological order; The connection interruption time in the offline data table is intercepted and summarized as a time dimension part, and is set as the recalculation start time; The connection recovery time in the offline data table is intercepted and summarized as a time dimension part, and the next summary time dimension is set as the recalculation end time; Query the business dimension table and the power on / off change table, extract all business dimension change events and device operation status change events between the recalculation start time and the recalculation end time, and sort them by event time to form an offline event update queue; Query the business dimension table, obtain the latest dimension value of each business dimension type before the recalculation start time, and set it as the value of the initial business dimension of the temporary recalculation business dimension startup rate table; set the pre-change state in the first equipment operation state change event after the recalculation start time as the value of the initial operation state of the temporary recalculation business dimension startup rate table; set the recalculation start time as the initial start time of the temporary recalculation business dimension startup rate table; For each data item in the offline update event queue, rematch the business dimension and the device operating status, recalculate the operating time and the total time, and store them in the temporary recalculated business dimension startup rate table: intercept the summary time dimension part of the event time in the queue data being processed as the value of the summary time dimension; for the device operating status change event in the offline update event queue, use the changed state as the value of the operating status; For the business dimension change event in the offline update event queue, the dimension value after the change is used as the value of the business dimension; the unupdated operation status and business dimension in the current data strip are filled with the value of the corresponding field of the previous data strip; the event time in the queue data being processed is used as the start time of the current data strip; the event time in the queue data being processed is used as the end time of the previous data strip, and the running time and total time of the previous data strip are calculated; Used to send the temporarily recalculated business dimension startup rate table that has been recalculated to the data storage module; clear the offline event update queue and the temporarily recalculated business dimension startup rate table; - A data storage module, used for receiving and storing the data of each match and calculation from the cloud real-time module; Used to receive and store the recalculated data from the cloud offline module to replace all data strips in the business dimension startup rate table within the range of the recalculation start time to the recalculation end time.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the device startup rate aggregation algorithm for cloud-edge joint computing as described in any one of claims 1-5.

8. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the device startup rate aggregation algorithm for cloud-edge joint computing described in any one of claims 1-5 are implemented.

Citation Information

Patent Citations

  • Cloud side-end cooperative industrial Internet of Things data acquisition control system and heterogeneous equipment gateway

    CN116546013A

  • Equipment data processing method and device, equipment and medium

    CN113055478A

  • Energy internet of things cloud edge collaboration method based on MQTT protocol and storage medium

    CN118353895A