An edge computing method for time series data processing system
By embedding algorithm management modules and plug-in algorithm engines in the edge gateway of the nuclear power edge computing system, using shared memory and semaphore mechanisms, the problems of system stability and algorithm model flexibility are solved, and efficient and flexible measurement point data processing is achieved. .
Patent Information
- Application Number
- CN202411636784.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-11-15
AI Technical Summary
The existing nuclear power edge computing system has stability problems when processing large amounts of measurement point data. The unstable algorithm engine may cause abnormalities in the entire edge gateway, and the existing algorithm model cannot be expanded and adjusted as needed to meet the needs of different measurement point data. Calculate requirements.
By embedding algorithm management modules and plug-in algorithm engines in the edge gateway, using shared memory and semaphore mechanisms, efficient calculation and processing of measured point data is achieved. The algorithm management module is responsible for creating and managing algorithm processes, the algorithm engine is responsible for computing and result processing, shared memory is used for data exchange, and semaphore is used for synchronous control.
Improve system stability, avoid edge gateway exceptions caused by instability of a single algorithm library, simplify algorithm management, improve data processing efficiency and flexibility, and can expand and adjust algorithm models as needed to meet the calculation of data of different measurement points. need.
Smart Images

Figure CN119149250B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of nuclear power technology, and in particular to an edge computing method for a time series data processing system. Background Art
[0002] With the development of Internet of Things technology, edge computing has been widely used in the field of nuclear power technology as an emerging computing model. The core concept of edge computing is to provide computing, storage, application and other services on the edge side close to the data source, so as to reduce network latency and improve the real-time performance of data processing. In this process, the algorithm engine plays a key role. It is responsible for converting complex algorithm logic into instructions that can be understood by the computer and performing efficient calculation and processing. In the existing nuclear power edge computing solution, the algorithm engine is usually integrated in the edge gateway to interact with the measurement point data to realize data calculation and processing. In order to improve the stability of the system, multi-threading or multi-process methods are usually adopted to enable multiple algorithm engines to run simultaneously. In addition, in order to facilitate management and scheduling, the algorithm engine is usually encapsulated in an algorithm library and managed by the algorithm management module. This design still has some problems in practical applications. First, if an algorithm engine is unstable, it may cause the entire edge gateway to be abnormal, which will undoubtedly affect the stability of the entire system, especially the collector. Secondly, due to the large amount of measurement point data, how to achieve efficient calculation and processing of a large number of specified measurement point data through each algorithm engine during the operation of the edge gateway is also a difficult problem that needs to be solved urgently. Finally, the algorithm model is usually fixed, that is, it can only process data from a specified combination of measurement points. In actual application, it cannot be expanded and adjusted as needed to meet the calculation requirements of data from different measurement points, which also limits its scope of application. Summary of the invention
[0003] In view of this, it is necessary to provide an edge computing method for a time series data processing system to solve the above problems.
[0004] The present invention provides an edge computing method for a time series data processing system, which performs measurement point data calculation based on an edge gateway, wherein the edge gateway includes an algorithm management module embedded in the edge gateway, an algorithm engine externally mounted on the edge gateway, and a shared memory, and performs measurement point data calculation based on the edge gateway, including the following steps:
[0005] S1, after receiving the creation instruction issued by the instruction issuing process, the algorithm management module and the algorithm engine create and initialize the corresponding algorithm process for the measuring point;
[0006] S2, based on the coordination of write semaphore, write event, result semaphore and result write event, cyclically executes writing of measuring point data, calling the corresponding algorithm process to calculate measuring point information to obtain calculation results and reading the calculation results, wherein each round of the cycle includes the following steps:
[0007] S21 measurement point data writing, including:
[0008] S211 The algorithm engine creates a write semaphore and resets a write event, triggering a write event;
[0009] S212 After the algorithm management module obtains the write signal, it notifies the external data writing process to connect to the shared memory to write the latest measurement point data into the data area of the shared memory;
[0010] S22 calculation result acquisition and writing, including:
[0011] S221: the algorithm management module releases the write semaphore, creates a result semaphore, and resets the result write event, triggering the result write event;
[0012] S222: After the algorithm engine obtains the write semaphore, write event and result semaphore, it connects to the shared memory and releases the write semaphore. After the algorithm engine calls the algorithm process to calculate the measurement point information and obtains the calculation result, it writes the calculation result into the shared memory.
[0013] S23 calculation results reading, including:
[0014] The algorithm engine releases the result semaphore, and after the algorithm management module obtains the result semaphore, it notifies the external data distribution process to connect to the shared memory to read the calculation result and distribute it;
[0015] After receiving the shutdown command issued by the command issuing process, S3 executes the last cycle, deletes the algorithm library, and ends the algorithm process.
[0016] Preferably, in step S1, the algorithm management module and the algorithm engine create a corresponding algorithm process for the measuring point and initialize it, including: after the algorithm management module calls the algorithm engine to generate an algorithm process for the specified measuring point and assigns an identifier according to the algorithm name and algorithm version, the algorithm management module initializes the algorithm process and allocates memory for the algorithm process.
[0017] Furthermore, the algorithm management module allocates memory for the algorithm process including:
[0018] (a) when initializing the algorithm process, creating a virtual memory for the algorithm process in the algorithm management module with the algorithm name and algorithm version;
[0019] (b) After initialization is completed, the calculation parameters are written into the virtual memory, and the calculation parameters are used to characterize the algorithm information of the measurement point matching.
[0020] Furthermore, the calculation parameters include one or more combinations of the algorithm name, version, use platform, algorithm dynamic library name, function name, calculation parameters, etc.
[0021] Preferably, when S222 calls the algorithm process to calculate the measuring point information and obtain the calculation result, the algorithm engine polls the identifier, and if it is determined that the current algorithm is an algorithm process bound to the measuring point, the measuring point information is calculated based on the algorithm process.
[0022] Preferably, when step S222 calls the algorithm process to calculate the measuring point information to obtain the calculation result, it also includes reading the virtual memory to obtain the calculation parameters and writing the calculation parameters into the queue to execute the calculation of the corresponding measuring point information.
[0023] Preferably, when the external data distribution process is connected to the shared memory to read and distribute the calculation result, it also includes the step of reading the calculation result identification to obtain the corresponding calculation result according to the calculation result identification number.
[0024] The present invention also discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the edge computing method for a time series data processing system when executing the computer program.
[0025] The present invention also discloses a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the edge computing method for a time series data processing system are implemented.
[0026] Compared with the prior art, the present invention has the following beneficial effects:
[0027] (1) Improving system stability: The present invention separates the algorithm library so that it can run independently, thus avoiding the situation where a single algorithm library is unstable and causes abnormalities in the edge gateway, thereby improving the stability of the system.
[0028] (2) Simplify algorithm management and ensure efficient data processing: The present invention simplifies algorithm management and improves management efficiency by embedding an algorithm management module in the edge gateway to encapsulate access to shared memory and semaphores.
[0029] (3) Improving algorithm execution efficiency: The present invention improves the algorithm execution efficiency by creating an external process and pulling a single algorithm process according to the algorithm name and algorithm version and the algorithm engine. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0031] FIG1 is a schematic diagram of a structural framework of an edge computing method for a time series data processing system provided by the present invention;
[0032] Figure 2 A schematic diagram of the workflow of an edge computing method for a time series data processing system provided by the present invention;
[0033] Figure 3 This is a schematic diagram of the hardware structure of the computer device provided by the present invention. DETAILED DESCRIPTION
[0034] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0035] See also Figure 1 and Figure 2 As shown, in this embodiment, an edge computing method for a time series data processing system performs algorithm calculation of measurement point data based on an edge gateway, and the edge gateway includes an algorithm management module embedded in the edge gateway, an algorithm engine and a shared memory externally mounted on the edge gateway, and the shared memory is used for writing and reading measurement point data and calculation results; the algorithm management module and the algorithm engine are used to connect to the shared memory according to a preset semaphore, and obtain the read and write permissions of the shared memory according to a preset event, and the algorithm calculation of the measurement point data based on the edge gateway includes the following steps:
[0036] S1, after receiving the creation instruction issued by the instruction issuing process, the algorithm management module and the algorithm engine create and initialize the corresponding algorithm process for the measuring point;
[0037] When a creation instruction is received to execute measurement point information calculation, the algorithm management module and the algorithm engine first cooperate to generate an algorithm process for the algorithm instance corresponding to the measurement point based on the binding information between the measurement point and the algorithm and the properties of the algorithm itself, and configure the relevant calculation parameters of the measurement point into the algorithm process for calculation during subsequent calls.
[0038] As a priority solution, in this embodiment, the algorithm management module and the algorithm engine create a corresponding algorithm process for the measuring point and initialize it, including: the algorithm management module calls the algorithm engine to generate an algorithm process for the specified measuring point and assigns an identifier according to the algorithm name and algorithm version, and the algorithm management module initializes the algorithm process and allocates memory for the algorithm process.
[0039] Furthermore, the algorithm management module allocates memory for the algorithm process including the following steps:
[0040] (a) when initializing the algorithm process, first create a virtual memory for the algorithm process in the algorithm management module with the algorithm name and algorithm version;
[0041] (b) After initialization, the calculation parameters are written into the virtual memory, wherein the calculation parameters include the algorithm name, version, platform, algorithm dynamic library name, function name, calculation parameters, etc., for matching between the algorithm instance and the measurement point.
[0042] The algorithm management module is mainly used for parameter configuration of external drivers and instruction reception and processing. The algorithm engine is mainly used to respond to the call of the algorithm management module to pull a single algorithm process and manage each algorithm process. In this embodiment, the algorithm engine creation interface is initAlg. When the algorithm process is pulled up by an external thread, there are mainly two parameters: algorithm library path and algorithm encoding, as shown in the following table:
[0043]
[0044] After the algorithm process corresponding to the measuring point is generated, the algorithm management module initializes and configures the algorithm process to bind the measuring point information with the algorithm process, which can be directly called in subsequent calculations.
[0045] S2 loops through the writing of measurement point data, calling the corresponding algorithm process to calculate measurement point information to obtain calculation results, and reading the calculation results based on the coordination of the write semaphore, the write event, the result semaphore, and the result write event.
[0046] After the algorithm process corresponding to the measuring point is set, the calculation of the measuring point information can be performed based on the algorithm process. However, considering the large number of measuring points in the nuclear power field, multiple measuring points are bound to algorithms, and one algorithm can be bound to multiple measuring points. When collecting measuring point data and edge computing, there are multiple algorithm processes. At the same time, the measuring point data collection and update speed are fast. When performing measuring point data calculation, the corresponding algorithm process needs to be able to respond efficiently. In order to ensure that the measuring point data can be calculated efficiently and safely, in this application, for each measuring point, through the cooperation of shared memory, events and semaphores, the calculation is executed cyclically, and the updated measuring point data is processed in time and the calculation results are passed out. At the same time, each algorithm process is managed by the algorithm engine, and when the calculation task of the measuring point is completed, the algorithm process and algorithm library are deleted in time.
[0047] Since the data in the measuring point is updated in real time, calculations must be performed for each updated measuring point data to obtain updated calculation results, wherein each cycle includes the following steps:
[0048] S21 measurement point data writing, including:
[0049] S211 The algorithm engine creates a write semaphore and resets a write event, triggering a write event;
[0050] S212 After the algorithm management module obtains the write signal, it notifies the external data writing process to connect to the shared memory to write the latest measurement point data into the data area of the shared memory;
[0051] After the write event is triggered, the external data writing process obtains the write permission of the shared memory and writes the latest measured point data collected by the measuring point into the data area of the shared memory.
[0052] S22 calculation result acquisition and writing, including:
[0053] S221 The algorithm management module releases the write semaphore, creates a result semaphore, and resets the result write event, triggering the result write event.
[0054] S222: After the algorithm engine obtains the write semaphore, write event and result semaphore, it connects to the shared memory and releases the write semaphore. After the algorithm engine calls the algorithm process to calculate the measurement point information and obtains the calculation result, it writes the calculation result into the shared memory.
[0055] Preferably, when S222 calls the algorithm process to calculate the measurement point information to obtain the calculation result, the algorithm engine polls the identifier. If it is determined that the current algorithm is an algorithm process bound to the measurement point, the measurement point information is calculated based on the algorithm process to avoid misuse of the algorithm process. As mentioned above, the edge gateway collects multiple measurement points at the same time, and an algorithm may be bound to multiple measurement points. The algorithm engine manages multiple algorithm processes at the same time. In order to avoid subsequent data errors caused by the misadjustment of the algorithm process, in this embodiment, a unique identifier is assigned to the algorithm process when it is pulled up. When the algorithm engine calls the algorithm process to perform data calculations for the corresponding measurement points, it first queries the identifier and confirms the corresponding relationship before making the call.
[0056] At the same time, before calling the algorithm process to calculate the measuring point information and obtain the calculation results, step S222 also includes reading the virtual memory to obtain the calculation parameters and writing the calculation parameters into the queue to perform the calculation of the corresponding measuring point information. Before the algorithm process calculates the measuring point data, it is also necessary to know the corresponding calculation parameters. In this embodiment, the calculation parameters are set in the virtual memory, and the algorithm process can directly obtain the corresponding parameter information from the virtual memory.
[0057] S23: Reading of calculation results. The algorithm engine releases the result semaphore. After the algorithm management module obtains the result semaphore, it notifies the external data distribution process to connect to the shared memory to read the calculation results and distribute them.
[0058] Preferably, in this embodiment, when the external data distribution process connects to the shared memory to read and distribute the calculation results, it also includes the step of reading the calculation result identification, and the calculation result identification is used to characterize the calculation result of the corresponding algorithm process. If the calculation result identification is obtained, the corresponding calculation result can be obtained according to the calculation result identification number, thereby avoiding the situation where the calculation results of multiple algorithm processes are misread, so as to further improve the accuracy of the data.
[0059] After receiving the shutdown command issued by the command issuing process, S3 executes the last cycle, deletes the algorithm library, and ends the algorithm process.
[0060] When the algorithm stops calculating from the outside and performs the last calculation to ensure the security of the shared memory, the algorithm instance is deleted and ends.
[0061] The edge computing method for a time series data processing system shown in the present invention, when the data is reported by the collection service, the corresponding data is transferred to the algorithm management module for processing. The algorithm management module calls the algorithm library for processing according to the algorithm corresponding to the configured measurement point, and transfers the processed calculation result to the data distribution process, wherein the algorithm engine is used for the management of the algorithm process, and the algorithm library is separated by the algorithm engine, and can be run separately, so as to avoid the abnormality of the edge gateway caused by the instability of a single algorithm library. Specifically, it performs the measurement point data calculation through each external independent algorithm process, without the need to perform the algorithm calculation inside the edge gateway (collector), so as to avoid the abnormality caused by the algorithm calculation, thereby affecting the normal operation of the collector;
[0062] At the same time, an algorithm management module is embedded in the edge gateway. The algorithm management module is used to encapsulate the access to shared memory and semaphores. The algorithm engine interacts with the algorithm management module through shared memory to perform measurement point information calculation and reading of calculation results, which simplifies algorithm management and improves management efficiency. Specifically, the shared memory has read and write permissions. The write semaphore and result semaphore are used to ensure that the shared memory is only called by one of the algorithm management module, algorithm engine, external data writing process, and external data distribution process at the same time. At the same time, the read and write permissions of the shared memory are obtained by executing the result write event and the write event, respectively, so as to ensure the orderly writing, calculation, and calculation results of the measurement point data.
[0063] The present invention also provides a computer device, such as a smart phone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server or cabinet server (including an independent server or a server cluster composed of multiple servers) that can execute programs. The computer device 20 of this embodiment includes at least but is not limited to: a memory 21 and a processor 22 that can communicate with each other via a system bus, such as Figure 3 It should be pointed out that Figure 3 Only computer device 20 is shown with components 21 - 22 , but it should be understood that implementing all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.
[0064] In this embodiment, the memory 21 (i.e., readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 21 can be an internal storage unit of the computer device 20, such as a hard disk or memory of the computer device 20. In other embodiments, the memory 21 can also be an external storage device of the computer device 20, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 20. Of course, the memory 21 can also include both the internal storage unit of the computer device 20 and its external storage device. In this embodiment, the memory 21 is generally used to store the operating system and various application software installed on the computer device 20, such as the program code of the method of the present invention, etc. In addition, the memory 21 can also be used to temporarily store various data that have been output or are to be output.
[0065] The processor 22 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip in some embodiments. The processor 22 is generally used to control the overall operation of the computer device 20. In this embodiment, the processor 22 is used to run the program code stored in the memory 21 or process data to implement an edge computing method for a time series data processing system.
[0066] The present invention also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a disk, an optical disk, a server, an App application store, etc., on which a computer program is stored, and the program realizes corresponding functions when executed by a processor. The computer-readable storage medium of this embodiment is used for a computer program, and when executed by a processor, an edge computing method for a time series data processing system is realized.
[0067] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed in the present invention should be covered by the present invention.
Claims
1. An edge computing method for a time series data processing system, which performs point data calculation based on an edge gateway, characterized in that: The edge gateway includes an algorithm management module embedded in the edge gateway, an algorithm engine externally mounted on the edge gateway, and a shared memory. Executing measurement point data calculation based on the edge gateway includes the following steps: S1, after receiving the creation instruction issued by the instruction issuing process, the algorithm management module and the algorithm engine create and initialize the corresponding algorithm process for the measuring point; S2, based on the coordination of write semaphore, write event, result semaphore and result write event, cyclically executes writing of measuring point data, calling the corresponding algorithm process to calculate measuring point information to obtain calculation results and reading the calculation results, wherein each round of the cycle includes the following steps: S21 measurement point data writing, including: S211 The algorithm engine creates a write semaphore and resets a write event, triggering a write event; S212 After the algorithm management module obtains the write signal, it notifies the external data writing process to connect to the shared memory to write the latest measurement point data into the data area of the shared memory; S22 calculation result acquisition and writing, including: S221: the algorithm management module releases the write semaphore, creates a result semaphore, and resets the result write event, triggering the result write event; S222: After the algorithm engine obtains the write semaphore, write event and result semaphore, it connects to the shared memory and releases the write semaphore. After the algorithm engine calls the algorithm process to calculate the measurement point information and obtains the calculation result, it writes the calculation result into the shared memory. S23 calculation results reading, including: The algorithm engine releases the result semaphore, and after the algorithm management module obtains the result semaphore, it notifies the external data distribution process to connect to the shared memory to read the calculation result and distribute it; After receiving the shutdown command issued by the command issuing process, S3 executes the last cycle, deletes the algorithm library, and ends the algorithm process.
2. According to claim 1, an edge computing method for a time series data processing system is characterized in that: In the step S1, the algorithm management module and the algorithm engine create a corresponding algorithm process for the measuring point and initialize it, including: after the algorithm management module calls the algorithm engine to generate an algorithm process for the specified measuring point and assigns an identifier according to the algorithm name and algorithm version, the algorithm management module initializes the algorithm process and allocates memory for the algorithm process.
3. The edge computing method for a time series data processing system according to claim 2, characterized in that: The algorithm management module allocates memory for the algorithm process including: (a) when initializing the algorithm process, creating a virtual memory for the algorithm process in the algorithm management module with the algorithm name and algorithm version; (b) After initialization is completed, the calculation parameters are written into the virtual memory, and the calculation parameters are used to characterize the algorithm information of the measurement point matching.
4. The edge computing method for a time series data processing system according to claim 3, characterized in that: The calculation parameters include one or more combinations of the algorithm name, version, use platform, algorithm dynamic library name, function name, calculation parameters, etc.
5. The edge computing method for a time series data processing system according to claim 1, characterized in that: When the algorithm process is called in S222 to calculate the measuring point information and obtain the calculation result, the algorithm engine polls the identifier, and if it is determined that the current algorithm is an algorithm process bound to the measuring point, the measuring point information is calculated based on the algorithm process.
6. The edge computing method for a time series data processing system according to claim 1, characterized in that: When calling the algorithm process to calculate the measuring point information to obtain the calculation result, S222 also includes reading the virtual memory to obtain the calculation parameters and writing the calculation parameters into the queue to execute the calculation of the corresponding measuring point information.
7. The edge computing method for a time series data processing system according to claim 1, characterized in that: When the external data distribution process S23 connects to the shared memory to read the calculation result and distributes it, it also includes the step of reading the calculation result identification to obtain the corresponding calculation result according to the calculation result identification number.
8. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 7 when executing the computer program.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
System resource scheduling method based on edge computing gateway
CN112114947A
Data interaction method and device, computer equipment and readable storage medium
CN115858198A