A micro-service-based deformation monitoring method and system
Patent Information
- Application Number
- CN202310011691.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-05
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2043-01-05
AI Technical Summary
[0004]本发明的目的在于提供一种基于微服务的形变监测方法及系统,旨在解决现有的形变监测系统存在的数据传输的时延过长以及数据传输过程中的吞吐量低且数据丢失的技术问题
Smart Images

Figure CN116149788B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer software technology, and in particular to a deformation monitoring method and system based on microservices. Background Technology
[0002] Currently, deformation monitoring technology in China has gradually reached a high level from various professional perspectives. Among them, the deformation monitoring system relying on the high-precision positioning technology of my country's Beidou Navigation Satellite System has been able to improve positioning accuracy to the millimeter level.
[0003] However, the current deformation monitoring system still has the following problems: 1. Due to the lack of suitable transmission tools and the design of suitable data transmission links, the data latency is too high when transmitting data from the calculation part to the deformation monitoring part; 2. Since each part of the system is deployed using traditional deployment methods, the system has poor stability, and when the system needs to be stopped during upgrades and optimizations, the data during the stop period is not monitored. Summary of the Invention
[0004] The purpose of this invention is to provide a deformation monitoring method and system based on microservices, which aims to solve the technical problems of excessively long data transmission latency, low throughput and data loss during data transmission in existing deformation monitoring systems.
[0005] To achieve the above objectives, this invention provides a microservice-based deformation monitoring method, comprising the following steps:
[0006] After the satellite observation data is processed by the calculation module, it is transmitted to the deformation monitoring module;
[0007] The deformation monitoring module performs data comparison and checks to determine the processing thread;
[0008] Determine if the number of data entries in each processing thread has reached n.
[0009] If the number is less than n, directly store the member variables in the thread and calculate the average value in the three directions within the thread.
[0010] If the number has reached n, update the member variables in the thread, and then calculate the average value in the three directions within the thread;
[0011] A reference value for deformation is obtained by calculating the average value;
[0012] Acquire all sensor data within the processing thread and calculate the deformation value by combining them according to different weights;
[0013] The deformation value is compared with a set threshold to determine whether deformation has occurred and the degree of deformation.
[0014] In the process of transferring satellite observation data from the calculation module to the deformation monitoring module, a message middleware is used to transfer the calculated data to the deformation monitoring module.
[0015] In the process of the deformation monitoring module comparing and checking data to determine the processing thread, the ID of the monitoring device in the transmitted data is checked first. If it is a monitoring device that already exists in the system, the thread responsible for it is found directly by the thread name, and the data is handed over to this thread for processing. If the monitoring device is not a monitoring device that already exists in the current thread, a new thread needs to be created based on the ID of this monitoring device to process all the data of this monitoring device.
[0016] Where n is the number of data entries calculated by combining the frequency and signal quality of the data transmitted from each monitoring device.
[0017] Specifically, the process of updating the member variables in a thread involves clearing the oldest data entry in the member variable that stores data in that thread and adding the current data to the member variable for storage.
[0018] The sensor data includes soil moisture meter variable s, crack meter variable c, and rain gauge variable r.
[0019] Wherein, the deformation value ,in, For the weight of the soil moisture meter, As the weight of the crack measurement, For the weight of the rain gauge, The weight of the mud level gauge.
[0020] This invention also proposes a system employing the aforementioned microservice-based deformation monitoring method, comprising a receiving module, a calculation module, a deformation monitoring module, an alarm module, and a storage module. The receiving module is used for satellite observation data, the calculation module calculates the satellite observation data, and the calculated data is used by the deformation monitoring module to determine whether it is abnormal. If an abnormality is found, an alarm is triggered by the alarm module; otherwise, it is saved in the storage module.
[0021] This invention provides a microservice-based deformation monitoring method and system. Addressing the latency and instability issues present in current deformation monitoring systems, this invention first uses a message middleware to handle all data transmission within the system. Then, it employs a microservice architecture combined with containerized deployment and a multi-node deployment method to improve system stability. Under high data concurrency, new nodes are automatically created to process the data. For data storage, a multi-source synchronous storage approach is used to provide disaster recovery capabilities. This solves the technical problems of excessively long data transmission latency, low throughput, and data loss during data transmission in existing deformation monitoring systems. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a flowchart illustrating a microservice-based deformation monitoring method according to the present invention.
[0024] Figure 2 This is a schematic diagram of the overall architecture of a microservice-based deformation monitoring method according to the present invention. Detailed Implementation
[0025] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0026] Please see Figure 1 This invention proposes a deformation monitoring method based on microservices, comprising the following steps:
[0027] S1: After the satellite observation data is processed by the calculation module, it is transmitted to the deformation monitoring module;
[0028] S2: The deformation monitoring module performs data comparison and checks to determine the processing thread;
[0029] S3: Determine if the number of data items in each processing thread has reached n.
[0030] If the number is less than n, directly store the member variables in the thread and calculate the average value in the three directions within the thread.
[0031] If the number has reached n, update the member variables in the thread, and then calculate the average value in the three directions within the thread;
[0032] S4: Obtain the reference value of deformation by averaging;
[0033] S5: Obtain all sensor data within the processing thread and calculate the deformation value by combining them according to different weights;
[0034] S6: Compare the deformation value with the set threshold to determine whether deformation has occurred and the degree of deformation.
[0035] The following section provides a further explanation of the microservice-based deformation monitoring method, along with specific implementation steps:
[0036] 1. After the satellite observation data is processed by the calculation module, the processed data is transmitted to the deformation monitoring module using the message middleware.
[0037] 2. In the deformation monitoring module, the ID of the monitoring device in the transmitted data will be checked first. If it is a monitoring device that already exists in the system, the thread responsible for it can be found directly by the thread name, and the data can be handed over to this thread for processing. If the monitoring device is not a monitoring device that already exists in the current thread, a new thread needs to be created to process all the data of this monitoring device, based on the ID of this monitoring device.
[0038] 3. In each thread of the deformation monitoring module, first determine whether the number of data entries in that thread has reached n. If it has not reached n, store the data directly in the member variable of that thread, and calculate the average value and other reference data in the three directions of that thread. If it has reached n, clear the earliest data entry in the member variable of that thread and add that data entry to the member variable for storage, and calculate the average value and other reference data in each direction of that thread. n is the number of data entries calculated by combining the frequency and signal quality of the data returned by each monitoring device. If there is one data entry per second and the signal quality is excellent, then n is taken as 120.
[0039] 4. In each thread of the deformation monitoring module, data in three directions are monitored simultaneously. Taking the E direction as an example: In the deformation algorithm, n data points are extracted, in the following order: E1, E2, E3, ..., En. The algorithm first calculates the average value of these data points. Finally, a reference value for deformation is calculated.
[0040] 5. In each thread of the deformation monitoring module, a comprehensive calculation is performed based on all sensors configured within the monitoring area, and the deformation value is calculated according to different weights. Specifically: the soil moisture meter variable s is divided into levels 0, 1, 2, and 3, with 0 representing the lowest soil moisture content and 3 representing the highest soil moisture content; the crack meter variable c is divided into levels 0, 1, 2, and 3, with 0 representing the lowest crack value and 3 representing the highest crack value; the rain gauge variable r is divided into levels 0, 1, 2, and 3, with 0 representing the lowest rainfall value and 3 representing the highest rainfall value; the mud level meter variable u is divided into levels 0, 1, 2, and 3, with 0 representing the lowest mud level value and 3 representing the highest mud level value.
[0041] 6. Based on the reference values calculated above and all the data collected from deformation monitoring, the deformation value can be calculated comprehensively: ,in, For the weight of the soil moisture meter, As the weight of the crack measurement, For the weight of the rain gauge, These are the weights for the mud level gauge. The weight values will vary depending on the project environment. Combining these weights with the reference values, the deformation can be calculated. By comparing the result with a threshold, it is possible to detect whether deformation has occurred and to what extent it has occurred.
[0042] Furthermore, the present invention also proposes a system employing the aforementioned microservice-based deformation monitoring method, comprising a receiving module, a calculation module, a deformation monitoring module, an alarm module, and a storage module. The receiving module is used for satellite observation data, the calculation module calculates the satellite observation data, and the calculated data is used by the deformation monitoring module to determine whether it is abnormal. If it is abnormal, the alarm module will issue an alarm prompt; if there is no abnormality, it will be saved in the storage module.
[0043] Specifically, the overall system architecture is shown in the diagram below. Figure 2 As shown:
[0044] This system is a deformation monitoring system built on a microservice architecture. The specific business layer includes deformation monitoring, alarm, data storage, and project management modules. Requests from user clients are uniformly distributed through a gateway to the various microservices in execution. In addition, the system has basic functional microservices including service registration, service communication, load balancing, caching mechanisms, and a logging system, facilitating automatic operation and repair of the entire system and improving its stability. The system's storage uses three databases with different storage strategies to store data, further saving storage space and reducing query time, thereby improving user efficiency in data retrieval.
[0045] 2.1 From the perspective of the information flow of user-initiated requests, the detailed design of this system from top to bottom is from the client to the gateway system. The gateway system forwards the request to the corresponding microservice in the business layer. Each microservice in the business layer is deployed independently and has its own independent database. The microservice in the business layer contains all business processing logic. The infrastructure layer provides technical support for various basic capabilities of the entire system, but does not contain business logic, such as service registration, load balancing, and distributed tracing.
[0046] 2.2 After the satellite signal is processed in the solution section, the data is transmitted to the deformation monitoring service using a message middleware.
[0047] 2.3 In the deformation monitoring service, the ID of the monitoring device in the transmitted data will be checked first. If it is a monitoring device that already exists in the system, the thread responsible for it will be found directly by the thread name, and the data will be handed over to that thread for processing. If the monitoring device does not already exist in the system, a new thread will be created according to the different monitoring device IDs to process all the data of this monitoring device.
[0048] 2.4 In each thread of the deformation monitoring service, after receiving new data, the latest received location data and sensor data will be comprehensively calculated and combined with other devices in the project to which the monitoring device belongs to comprehensively determine whether deformation will occur. If deformation occurs, the time, monitoring device ID, location data, sensor data and other data need to be transmitted to the alarm service.
[0049] 2.5 In the alarm service, if relevant data is received, the contact information of the relevant project manager will be found and a text message and email will be sent to them. If the project has installed and deployed an audible and visual alarm, it will be activated to alert people in the vicinity of the project.
[0050] 2.6 After the deformation monitoring service is completed, the data, including time, monitoring device ID, and location coordinates, will be transmitted to the data storage service through the message middleware.
[0051] 2.7 In the data storage service, two database synchronization methods are used to synchronously store data in the relational database MySQL and the non-relational database MongoDB. In MySQL, a master-slave replication cluster approach is used for storage; in MongoDB, a highly available distributed cluster approach is used.
[0052] 2.8 When a user queries data, the system sends the user's query parameters to the data query service and retrieves data from the database according to the parameter requirements. However, during this process, the service first verifies the validity of the parameters, such as the validity of time range queries. If the parameters are valid, the system queries the data and, according to the user's selection, sends it to the list display service or the graph display service for visualization.
[0053] 2.9 This system also has a report generation service. It will transmit the relevant parameters to the data query service according to the configuration on the user page, and generate Excel or PDF reports according to the preset format selected by the user based on the queried data.
[0054] 2.10. This system also has a monitoring project configuration function. In this service, you can freely configure the project to which each monitoring device or sensor device belongs, and you can use a list or visual form to flexibly configure the monitoring device.
[0055] The present invention also provides a specific embodiment for step description:
[0056] Step 1: The entire system was deployed using a containerized deployment approach, combined with a microservices architecture that is well-suited to the system's needs. Each service in the system was encapsulated as a microservice, and each microservice was deployed using a different container. Nodes within each module can be deployed using multiple containers. If one container fails or needs to be shut down for upgrades or optimizations, the remaining containers can still share the workload normally, preventing system downtime.
[0057] Step 2: After receiving the data from the monitoring device, the data processing module completes the data processing according to a specific algorithm and sends the processed data to the deformation monitoring service through the message middleware.
[0058] Step 3: After receiving the data, the deformation monitoring service uses a deformation monitoring algorithm to monitor the data. By combining the location coordinate data and sensor data, it comprehensively judges whether the coordinate has been deformed. If deformation has occurred, it will send the relevant data to the alarm service.
[0059] Step 4: In the deformation monitoring service, after monitoring the data, the data is sent to the data storage service through the message middleware, where the data storage is completed.
[0060] Step 5: The data storage service employs a multi-database fusion and synchronous storage approach for data storage. After receiving data, the data storage service synchronously stores it in relational databases, non-relational databases, and time-series databases. For relational databases, the system uses a MySQL master-slave replication cluster; for non-relational databases, it uses a MongoDB high-availability multi-node cluster; and for time-series databases, it uses an InfluxDB cluster. During data storage, the service simultaneously stores the data in all three databases and checks the results. If inconsistencies are found between the different databases, corrections are made.
[0061] Step Six: In the alarm service, after receiving the alarm information, the service will look up the monitoring device ID in the database to find the area to which the monitoring device belongs, determine the email address and mobile phone number of the person in charge, send emails and text messages, and use relevant protocols to activate the audible and visual alarm in the monitoring device to complete the evacuation of residents.
[0062] Step 7: When a user needs to search for specific data, the data query service will, after verifying the parameters, analyze the characteristics of different services or the query conditions, find the data that meets the query conditions from the database type that best meets the requirements, and then pass it to the list display service or the graph display service for visualization according to the user's needs.
[0063] Step 8: When a user needs to generate a report for a specific project and time period, the data query service will retrieve data that meets the conditions from the database, transmit the relevant data to the reporting service, and generate a report for the user to download.
[0064] Step 9: Users can configure relevant information for the monitored items.
[0065] In summary, the present invention has the following advantages:
[0066] 1. By using microservice framework concepts, containerized deployment concepts, message middleware tools, and a combination of multiple storage methods, the problems existing in the previous version can theoretically be completely eliminated;
[0067] 2. Using message middleware to complete all data transmission functions in the entire system, it can transmit more than a thousand data messages per second, solving the problems of slow data transmission and occasional data loss;
[0068] 3. The system utilizes a microservice architecture combined with containerized deployment and a multi-node deployment method, which improves the stability of the system. Under high data concurrency, the system can automatically create new nodes to process the data and automatically delete nodes when they are no longer needed, thereby saving server resources.
[0069] 4. Regarding data storage, a multi-data synchronous storage approach is used, storing data in both relational and non-relational databases. Master-slave replication clusters or high-availability clusters are deployed in each database, which can provide a certain degree of disaster recovery.
[0070] 5. Since this method is based on the Spring framework, its built-in method library can be used during the coding process, which can shorten the development cycle and deliver the product earlier.
[0071] The above description discloses only one preferred embodiment of the present invention, and should not be construed as limiting the scope of the present invention. Those skilled in the art will understand that all or part of the processes of the above embodiments can be implemented, and equivalent changes made in accordance with the claims of the present invention are still within the scope of the invention.
Claims
1. A deformation monitoring method based on microservices, characterized in that, Includes the following steps: After the satellite observation data is processed by the calculation module, it is transmitted to the deformation monitoring module; The deformation monitoring module performs data comparison and checks to determine the processing thread; Determine if the number of data entries in each processing thread has reached n. If the number is less than n, directly store the member variables in the thread, and at the same time calculate the average value of each of the three directions within the thread; If the number has reached n, update the member variables in the thread, and then calculate the average value of each of the three directions within the thread; A reference value for deformation is obtained by calculating the average value; Acquire all sensor data within the processing thread and calculate the deformation value by combining them according to different weights; The deformation value is obtained by subtracting the deformation reference value from the deformation value and compared with the set threshold to determine whether deformation has occurred and the degree of deformation.
2. The deformation monitoring method based on microservices as described in claim 1, characterized in that, After the satellite observation data is processed by the processing module, it is transmitted to the deformation monitoring module using a message middleware.
3. The deformation monitoring method based on microservices as described in claim 1, characterized in that, During the data comparison and checking process of the deformation monitoring module to determine the processing thread, the ID of the monitoring device in the transmitted data is checked first. If it is a monitoring device that already exists in the system, the thread responsible for it is found directly by the thread name, and the data is handed over to this thread for processing. If the monitoring device is not a monitoring device that already exists in the current thread, a new thread needs to be created to process all the data of this monitoring device, based on the ID of this monitoring device.
4. The deformation monitoring method based on microservices as described in claim 1, characterized in that, n is the number of data entries calculated by combining the frequency and signal quality of the data transmitted from each monitoring device.
5. The deformation monitoring method based on microservices as described in claim 1, characterized in that, The process of updating member variables in a thread involves clearing the oldest data entry in the member variable that stores data in that thread and adding the current data to the member variable for storage.
6. The deformation monitoring method based on microservices as described in claim 1, characterized in that, The sensor data includes soil moisture meter variable s, crack meter variable c, and rain gauge variable r.
7. The deformation monitoring method based on microservices as described in claim 1, characterized in that, The deformation value ,in, For the weight of the soil moisture meter, As the weight of the crack measurement, For the weight of the rain gauge, E represents the weight of the mud level gauge. n This is the nth data point in the direction of monitoring point E, where u is the variable of the mud level gauge.
8. A system employing the microservice-based deformation monitoring method as described in claim 1, characterized in that, It includes a receiving module, a calculation module, a deformation monitoring module, an alarm module, and a storage module. The receiving module is used to receive satellite observation data. The calculation module calculates the satellite observation data. The calculated data is then used by the deformation monitoring module to determine whether there are any abnormalities. If there are any abnormalities, the alarm module will issue an alarm. If there are no abnormalities, the data will be saved in the storage module.
Citation Information
Patent Citations
Three-way intelligent laser roadway deformation monitoring device and three-way intelligent laser roadway deformation monitoring method
CN108225208A
Micro-service data synchronization method and device and computer readable storage medium
CN111209120A