A backend service system, method, electronic device and storage medium
Patent Information
- Application Number
- CN202611486868.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-23
- Publication Date
- 2026-10-27
AI Technical Summary
[0004]有鉴于此,本申请实施例提供了一种后端服务系统、方法、电子设备及存储介质,以解决现有技术中,不同业务功能之间以及业务逻辑与外部资源访问逻辑之间耦合度较高,导致后端服务系统扩展和维护困难的问题
[0007]本申请实施例的第三方面,提供了一种电子设备,包括存储器、处理器以及存储在存储器中并且可在处理器上运行的计算机程序,该处理器执行计算机程序时实现上述方法的步骤。
Smart Images

Figure CN122994367A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of industrial equipment management technology, and in particular to a back-end service system, method, electronic device and storage medium. Background Technology
[0002] In industrial control systems, back-end service systems typically need to receive different business requests sent by front-end devices and execute corresponding business functions according to these requests. In the process of executing business functions, back-end service systems may also need to access databases or interact with PLC engineering services to obtain or store the data required for business processing.
[0003] In existing backend service systems, the business processing logic for different business requests, as well as the external resource access logic such as database access and PLC communication, are usually set in the same processing procedure. For example, after receiving a business request, the processing program needs to identify and execute the corresponding business logic, and also needs to directly call the database interface or PLC communication interface to complete data interaction. As a result, the processing logic corresponding to different business functions is easily related to each other, and the business logic and the specific external resource access method are also easily directly dependent. Summary of the Invention
[0004] In view of this, embodiments of this application provide a backend service system, method, electronic device, and storage medium to solve the problem in the prior art where the high degree of coupling between different business functions and between business logic and external resource access logic leads to difficulties in expanding and maintaining the backend service system.
[0005] A first aspect of this application provides a backend service system, comprising: a presentation layer, an application layer, a domain layer, and an infrastructure layer; the presentation layer is configured to receive business requests sent by a front-end device and provide the business requests to the application layer; the application layer is configured with multiple application services corresponding to multiple business functions, and is configured to determine a target application service from the multiple application services according to the business request, and call the domain layer through the target application service to execute the target business function corresponding to the business request, wherein the application services corresponding to each business function are independent of each other to isolate different business functions; the domain layer is configured to execute the business logic corresponding to the target business function according to the call of the target application service; the infrastructure layer is configured with multiple adapter components for accessing different external resources, and is configured to determine a target adapter component corresponding to the target external resource to be accessed from the multiple adapter components according to the call of the target application service, and access the target external resource through the target adapter component.
[0006] A second aspect of this application provides a backend service method, comprising: receiving a service request sent by a frontend device; determining a target application service from multiple application services corresponding to multiple business functions according to the service request, and determining the business function corresponding to the target application service as the target business function; invoking a domain layer through the target application service to enable the domain layer to execute the business logic corresponding to the target business function; and, when executing the business logic corresponding to the target business function requires accessing external resources, determining the target external resource to be accessed, and invoking a target adapter component in the infrastructure layer corresponding to the target external resource through the target application service to access the target external resource through the target adapter component; wherein the infrastructure layer is provided with multiple adapter components for accessing different external resources, the multiple adapter components including at least a data storage adapter component and a communication adapter component, the communication adapter component being used to interact with a PLC engineering service through a preset communication middleware.
[0007] A third aspect of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method.
[0008] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method.
[0009] The beneficial effects of this application embodiment compared with the prior art are as follows: According to the solution provided by this application embodiment, the backend service system includes a presentation layer, an application layer, a domain layer, and an infrastructure layer; the presentation layer is used to receive business requests sent by the front-end device and provide the business requests to the application layer; the application layer is configured with multiple application services corresponding to multiple business functions, used to determine the target application service from the multiple application services according to the business request, and to call the domain layer through the target application service to execute the target business function corresponding to the business request, wherein the application services corresponding to each business function are independent of each other, so that different business functions are isolated from each other; the domain layer is used to execute the business logic corresponding to the target business function according to the call of the target application service; the infrastructure layer is configured with access... Multiple adapter components for different external resources are used to determine the target adapter component corresponding to the target external resource to be accessed from among multiple adapter components based on the call of the target application service, and access the target external resource through the target adapter component. In this way, by setting up independent application services for different business functions, and implementing the execution of business logic and access to external resources by the domain layer and infrastructure layer respectively, different business functions are isolated from each other, and business logic is isolated from specific external resource access methods. This reduces the coupling between different business functions and between business logic and external resource access logic, and avoids the problem of high coupling between different business functions and between business logic and external resource access logic, which leads to difficulties in the expansion and maintenance of the backend service system. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the embodiments of this application, 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 this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 This is a basic schematic diagram of a backend service system provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0012] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0013] A backend service system and method according to an embodiment of this application will now be described in detail with reference to the accompanying drawings.
[0014] Figure 1 This is a basic schematic diagram of a backend service system provided in an embodiment of this application, such as... Figure 1 As shown, the system includes: presentation layer 201, application layer 202, domain layer 203, and infrastructure layer 204; The presentation layer 201 receives business requests sent by the front-end device and provides these requests to the application layer 202. The application layer 202 has multiple application services corresponding to multiple business functions. It determines the target application service from among the multiple application services based on the business request and calls the domain layer 203 through the target application service to execute the target business function corresponding to the business request. The application services corresponding to each business function are independent of each other to isolate different business functions. The domain layer 203 executes the business logic corresponding to the target business function based on the call to the target application service. The infrastructure layer 204 has multiple adapter components for accessing different external resources. It determines the target adapter component corresponding to the target external resource to be accessed from among the multiple adapter components based on the call to the target application service and accesses the target external resource through the target adapter component.
[0015] In some examples, the front-end device is a computer, industrial control computer, or other terminal device running a browser or client program. Users access the operation interface provided by the back-end service system through the front-end device and initiate business requests based on the corresponding operation interface. The business requests are used to request the execution of any one of the business functions such as unit configuration, measurement point configuration, spare parts management, trend push, alarm management, overview display, or general overview.
[0016] Presentation layer 201 serves as the data interaction entry point between the backend service system and the frontend device. It provides interfaces corresponding to different business functions to the frontend device. For example, presentation layer 201 can receive configuration or query business requests sent by the frontend device through the REST interface, and can also push trend data or alarm data to the frontend device in real time through the WebSocket interface. After receiving a business request, presentation layer 201 provides the business request to application layer 202 without executing specific business logic in presentation layer 201.
[0017] Application layer 202 is configured with multiple application services, each corresponding to a different business function. For example, the backend service system provides functions such as unit configuration, measurement point configuration, spare parts management, trend push, and alarm management. Application layer 202 is configured with application services corresponding to these functions.
[0018] After obtaining the business request provided by the presentation layer 201, the application layer 202 can determine the target application service corresponding to the business request from multiple application services, and identify the business function corresponding to the target application service as the target business function. The target application service calls the domain layer 203 to execute the business logic corresponding to the target business function.
[0019] In this system, the application services corresponding to different business functions are set up independently, and different application services do not directly call each other's internal business processing logic. For example, the application service corresponding to the test point configuration function does not need to call the application service corresponding to the spare parts management function to complete the test point configuration business; the application service corresponding to the spare parts management function also does not need to depend on the application service corresponding to the test point configuration function. Thus, different business functions are isolated from each other, and different business functions can be maintained, modified or split independently according to actual business needs.
[0020] Domain layer 203 is used to carry the business logic corresponding to each business function. Domain layer 203 is set with domain objects such as aggregate root, entity, value object and domain event, as well as domain services. After determining the target business function corresponding to the target application service, the target application service calls the domain object and / or domain service in domain layer 203 corresponding to the target business function so that the corresponding domain object and / or domain service executes the business logic corresponding to the target business function.
[0021] For example, for the unit configuration function, the domain layer 203 performs configuration processing related to the mechanical system, subsystem, and data acquisition based on the received unit configuration information; for the measurement point configuration function, it performs business processing related to the measurement point configuration. The domain layer 203 only focuses on the corresponding business rules and does not directly rely on the implementation methods of specific external resources such as databases and PLC engineering services.
[0022] The infrastructure layer 204 is used to provide specific implementations for the backend service system to access external resources. The infrastructure layer 204 sets up corresponding adaptation components for different types of external resources. For example, it sets up a data storage adaptation component for accessing the database, a communication adaptation component for communicating with the PLC engineering service, and an algorithm service adaptation component for accessing the algorithm service. When the target application service needs to access external resources in the process of calling the domain layer 203 to execute the business logic corresponding to the target business function, it determines the corresponding adaptation component according to the external resource to be accessed and calls the adaptation component to complete the corresponding external resource access.
[0023] For example, when the target business function is a measurement point configuration function, the application layer 202 determines the target application service corresponding to the measurement point configuration function based on the measurement point configuration request sent by the front-end device, and calls the domain layer 203 through the target application service to execute the corresponding measurement point configuration business logic. When the measurement point configuration business needs to save configuration data, the target application service calls the data storage adapter component in the infrastructure layer 204 to store the corresponding configuration data in the database; when the measurement point configuration business needs to interact with the PLC engineering service, the target application service calls the communication adapter component in the infrastructure layer 204 to interact with the PLC engineering service through a preset communication middleware.
[0024] Therefore, the backend service system forms a layered processing process: presentation layer 201 receives business requests, application layer 202 determines the target application service, domain layer 203 executes business logic, and infrastructure layer 204 accesses external resources. Different business functions are processed through corresponding application services, thereby reducing the coupling between different business functions. On the other hand, specific business logic and external resource access logic such as database access and PLC communication are respectively carried by domain layer 203 and infrastructure layer 204, thereby reducing the coupling between business logic and specific external resource implementation methods, which facilitates the expansion and maintenance of different business functions and external resource access methods in the backend service system.
[0025] According to the solution provided in the embodiments of this application, the backend service system includes a presentation layer 201, an application layer 202, a domain layer 203, and an infrastructure layer 204. The presentation layer 201 is used to receive service requests sent by the front-end device and provide the service requests to the application layer 202. The application layer 202 is configured with multiple application services corresponding to multiple business functions, used to determine the target application service from the multiple application services according to the service request, and to call the domain layer 203 through the target application service to execute the target business function corresponding to the service request. The application services corresponding to each business function are independent of each other to isolate different business functions. The domain layer 203 is used to execute the business logic corresponding to the target business function according to the call to the target application service. The infrastructure layer 204 is configured with access control... Multiple adapter components for different external resources are used to determine the target adapter component corresponding to the target external resource to be accessed based on the call of the target application service. The target external resource is then accessed through the target adapter component. In this way, by setting up independent application services for different business functions and implementing the execution of business logic and access to external resources by the domain layer 203 and the infrastructure layer 204 respectively, different business functions are isolated from each other, and business logic is isolated from specific external resource access methods. This reduces the coupling between different business functions and between business logic and external resource access logic, avoiding the problem of high coupling between different business functions and between business logic and external resource access logic, which leads to difficulties in the expansion and maintenance of the backend service system.
[0026] In some examples, multiple business functions include at least two of the following: unit configuration function, measurement point configuration function, spare parts management function, trend push function, alarm management function, overview display function, and overall function; multiple application services include application services corresponding to at least two of the following: unit configuration function, measurement point configuration function, spare parts management function, trend push function, alarm management function, overview display function, and overall function.
[0027] In some examples, the adapter component includes a data storage adapter component. The application layer 202 is also used to call the data storage adapter component to initialize the database structure when the backend service system starts, and to determine whether the basic data corresponding to the unit, system, data collection quantity and measurement point has been initialized. If the basic data has not been initialized, the domain layer 203 is called to perform the initialization of the basic data corresponding to the unit, system, data collection quantity and measurement point, and the initialized basic data is stored through the data storage adapter component.
[0028] The adapter components include communication adapter components. The application layer 202 is also used to obtain PLC configuration information after determining that the basic data has been initialized (or the initialization of the basic data has been completed), and to call the communication adapter components to perform PLC connection tests based on the PLC configuration information. If the PLC connection test passes, the communication adapter components are used to manage the communication connection with the PLC engineering service, and to subscribe to PLC data through the communication connection.
[0029] It is understandable that when the backend service system starts, the application layer 202 calls the data storage adapter component to initialize the database structure so that the database has a data structure for storing business data related to the backend service system. After the database structure initialization is completed, the application layer 202 further calls the data storage adapter component to read the basic data in the database and determines whether the basic data corresponding to the unit, system, collection quantity and measurement point has been initialized based on the reading result.
[0030] The basic data corresponding to the generator set, system, data collection quantity, and measurement point are used to characterize the basic configuration relationship of the generator set managed by the backend service system, the system contained in the generator set, the data collection quantity corresponding to each system, and the corresponding measurement point. If it is determined that the basic data has not been initialized, the application layer 202 calls the domain layer 203 to execute the corresponding basic data initialization business logic to obtain the basic data corresponding to the generator set, system, data collection quantity, and measurement point, and calls the data storage adaptation component to store the initialized basic data in the database. If it is determined that the basic data has been initialized, the existing basic data in the database can be used directly without repeating the basic data initialization.
[0031] After confirming that the basic data has been initialized or has been initialized, the application layer 202 further obtains the PLC configuration information. The PLC configuration information is used to establish a PLC communication connection. In some examples, the PLC configuration information is pre-stored in the database. The application layer 202 obtains the PLC configuration information by calling the data storage adapter component.
[0032] Application layer 202 calls the communication adapter component in infrastructure layer 204 based on PLC configuration information. The communication adapter component interacts with PLC engineering service through preset communication middleware and performs PLC connection test to determine whether a valid communication connection can be established based on PLC configuration information. If the PLC connection test is passed, application layer 202 calls the communication adapter component to establish and manage the communication connection with PLC engineering service and subscribes to PLC data through the communication connection.
[0033] Among them, the communication adapter component is responsible for the specific communication process with the PLC engineering service. The application layer 202 does not need to directly implement the PLC communication logic. The PLC data obtained by subscription can be provided to the application services corresponding to business functions such as trend push and alarm management, so that the corresponding application services can perform subsequent business processing based on the PLC data.
[0034] Therefore, during the startup of the backend service system, the database structure and basic data are initialized through the data storage adapter component. After the basic data is initialized, the PLC connection test, communication connection management, and PLC data subscription are completed through the communication adapter component based on the PLC configuration information. This allows database access and PLC communication to be implemented through the corresponding adapter components, reducing the coupling between the application layer 202 and the specific data storage method and PLC communication implementation method, and providing the corresponding basic data and PLC data for the execution of subsequent business functions.
[0035] In some examples, the business function includes a trend push function. The application service corresponding to the trend push function is used to obtain the subscribed PLC data and determine the data to be pushed from the PLC data according to the real-time push strategy configured by the user. The data to be pushed is sampled according to a preset time range, and the sampled data is pushed to the front-end device according to the data push dimension selected by the user. The preset time range includes at least one of 1 hour, 8 hours and 24 hours.
[0036] The real-time push strategy is used to indicate the range, data type and / or push conditions of the data that need to be pushed in real time. After the application service corresponding to the trend push function obtains the PLC data subscribed through the communication connection, it selects the data to be pushed from the PLC data according to the real-time push strategy pre-configured by the user.
[0037] For data that needs to display the trend of change within a certain time range, the application service samples the data to be pushed according to a preset time range to reduce the amount of data that needs to be transmitted. The preset time range can be 1 hour, 8 hours or 24 hours. Different time ranges correspond to different sampling methods or sampling frequencies to obtain sampled data that can represent the trend of data change within the corresponding time range.
[0038] After obtaining the sampled data, the application service determines the data to be pushed to the front-end device based on the data push dimension selected by the user, and pushes the corresponding data to the front-end device so that the front-end device can display the corresponding trend data.
[0039] In some examples, the business functions include alarm management functions. The application service corresponding to the alarm management function is used to obtain PLC data subscribed through the communication connection and the measurement point configuration information corresponding to the PLC data, and determine the alarm conditions corresponding to the PLC data based on the measurement point configuration information; perform alarm analysis on the PLC data based on the alarm conditions to determine the abnormal measurement points that meet the alarm conditions; generate alarm information based on the abnormal measurement points, and push the alarm information to the front-end device.
[0040] The measurement point configuration information includes information such as measurement point identifier, measurement point type, alarm threshold, alarm level, and duration conditions used for alarm judgment. The application service determines the corresponding measurement point configuration information based on the measurement point identifier corresponding to the PLC data, and determines the alarm conditions corresponding to the current PLC data based on the measurement point configuration information.
[0041] For example, for temperature measuring points, the upper temperature threshold and / or lower temperature threshold corresponding to the temperature measuring point are determined according to the measuring point configuration information; for vibration measuring points, the corresponding vibration alarm threshold is determined according to the measuring point configuration information. The application service compares the PLC data with the corresponding alarm conditions, or analyzes the PLC data based on the alarm conditions, such as duration and trend of change, to determine whether the corresponding measuring point meets the preset alarm conditions.
[0042] If a certain measuring point meets the preset alarm conditions, the measuring point is identified as an abnormal measuring point, and alarm information is generated based on the measuring point configuration information and PLC data corresponding to the abnormal measuring point. The alarm information includes, but is not limited to, at least one of the following: abnormal measuring point identifier, abnormal data, alarm threshold, alarm level, abnormal duration, risk item, etc.
[0043] After generating alarm information, the application service corresponding to the alarm management function pushes the alarm information to the front-end device through the presentation layer 201, so that the front-end device can display the corresponding abnormal measurement points and their alarm information, thereby making it easier for users to know about the abnormal situation of the measurement points in a timely manner.
[0044] In some examples, the adapter component also includes an algorithm service adapter component; the application service corresponding to the alarm management function is also used to call the algorithm service adapter component, send the PLC data and the corresponding measurement point configuration information to the algorithm service, and obtain the calculation results returned by the algorithm service; determine whether the PLC data exceeds the alarm line of the corresponding measurement point based on the calculation results, and generate alarm information if the alarm line is exceeded.
[0045] The algorithm service adaptation component is used to provide the backend service system with the ability to interact with the algorithm service. After the application service corresponding to the alarm management function obtains the PLC data and the corresponding measurement point configuration information, it calls the algorithm service adaptation component to send the PLC data and measurement point configuration information to the algorithm service. The algorithm service performs calculations based on the PLC data and measurement point configuration information and returns the calculation results to the application service through the algorithm service adaptation component.
[0046] The measurement point configuration information includes the alarm line of the corresponding measurement point. The alarm line is used to characterize the judgment condition between the normal operation state and the abnormal operation state of the corresponding measurement point. The calculation result includes the result data used to characterize the operation state of the measurement point based on the PLC data. After the application service corresponding to the alarm management function obtains the calculation result, it compares the calculation result with the alarm line of the corresponding measurement point to determine whether the operation state of the measurement point represented by the PLC data exceeds the alarm line.
[0047] If the PLC data exceeds the alarm threshold of the corresponding measurement point, the corresponding measurement point is identified as an abnormal measurement point. Based on the calculation results, PLC data and / or measurement point configuration information, corresponding alarm information is generated. The alarm information includes at least one of the following: risk item, duration, alarm threshold, possible cause of failure and recommended handling suggestions. The alarm information is then pushed to the front-end device through the display layer 201.
[0048] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.
[0049] Based on the same concept, this application also provides a backend service method, which includes: S101, Receive service requests sent by the front-end device; S102. Based on the business request, determine the target application service from multiple application services that correspond to multiple business functions, and determine the business function corresponding to the target application service as the target business function. S103. Call the domain layer through the target application service so that the domain layer can execute the business logic corresponding to the target business function; S104. When the business logic corresponding to the target business function requires access to external resources, the target external resource to be accessed is determined, and the target application service calls the target adapter component in the infrastructure layer corresponding to the target external resource to access the target external resource through the target adapter component; wherein, the infrastructure layer is provided with multiple adapter components for accessing different external resources, and the multiple adapter components include at least a data storage adapter component and a communication adapter component. The communication adapter component is used to interact with the PLC engineering service through a preset communication middleware.
[0050] It is understood that the backend service method provided in this application is applied to the backend service system described above. For any content of the backend service method that is not disclosed, please refer to the content disclosed in the backend service system described above.
[0051] Figure 2 This is a schematic diagram of the electronic device 3 provided in an embodiment of this application. Figure 2 As shown, the electronic device 3 of this embodiment includes: a processor 301, a memory 302, and a computer program 303 stored in the memory 302 and executable on the processor 301. When the processor 301 executes the computer program 303, it implements the steps in the various method embodiments described above. Alternatively, when the processor 301 executes the computer program 303, it implements the functions of each module / unit in the various system embodiments described above.
[0052] Electronic device 3 can be a desktop computer, laptop, handheld computer, cloud server, or other electronic device. Electronic device 3 may include, but is not limited to, processor 301 and memory 302. Those skilled in the art will understand that... Figure 2 This is merely an example of electronic device 3 and does not constitute a limitation on electronic device 3. It may include more or fewer components than shown, or different components.
[0053] The processor 301 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0054] The memory 302 can be an internal storage unit of the electronic device 3, such as a hard disk or memory of the electronic device 3. The memory 302 can also be an external storage device of the electronic device 3, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 3. The memory 302 can also include both internal and external storage units of the electronic device 3. The memory 302 is used to store computer programs and other programs and data required by the electronic device.
[0055] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0056] If an integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program may include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium may include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in a computer-readable medium can be appropriately added to or subtracted according to the requirements of legislation and patent practice in a jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0057] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A backend service system, characterized in that, The backend service system includes a presentation layer, an application layer, a domain layer, and an infrastructure layer; The presentation layer is used to receive business requests sent by the front-end device and provide the business requests to the application layer; The application layer is configured with multiple application services corresponding to multiple business functions. These services are used to determine a target application service from among the multiple application services based on the business request, and then invoke the domain layer through the target application service to execute the target business function corresponding to the business request. Each application service corresponding to a business function is independent of the others, ensuring isolation between different business functions. The multiple business functions include at least two of the following: unit configuration function, measurement point configuration function, spare parts management function, trend push function, alarm management function, overview display function, and overall function. The multiple application services include application services corresponding to at least two of the following functions: unit configuration function, measurement point configuration function, spare parts management function, trend push function, alarm management function, overview display function, and overall function. The domain layer is used to execute the business logic corresponding to the target business function based on the call to the target application service; The infrastructure layer is provided with multiple adaptation components for accessing different external resources. Based on the call of the target application service, the target adaptation component corresponding to the target external resource to be accessed is determined from the multiple adaptation components, and the target external resource is accessed through the target adaptation component.
2. The system according to claim 1, characterized in that, The adaptation component includes a data storage adaptation component. The application layer is also used to call the data storage adaptation component to initialize the database structure when the backend service system starts, and to determine whether the basic data corresponding to the unit, system, collection quantity and measurement point have been initialized. If the basic data is not initialized, the domain layer is invoked to perform basic data initialization for the unit, the system, the collected data, and the measurement point, and the initialized basic data is stored through the data storage adapter component.
3. The system according to claim 2, characterized in that, The adaptation component includes a communication adaptation component. The application layer is further configured to obtain PLC configuration information after determining that the basic data has been initialized, and call the communication adaptation component to perform PLC connection testing based on the PLC configuration information; if the PLC connection test passes, manage the communication connection with the PLC engineering service through the communication adaptation component, and subscribe to PLC data through the communication connection.
4. The system according to claim 1, characterized in that, The business function includes a trend push function. The application service corresponding to the trend push function is used to obtain subscribed PLC data and determine the data to be pushed from the PLC data according to the real-time push strategy configured by the user. The data to be pushed is sampled according to a preset time range and the sampled data is pushed to the front-end device according to the data push dimension selected by the user. The preset time range includes at least one of 1 hour, 8 hours and 24 hours.
5. The system according to claim 1, characterized in that, The business function includes an alarm management function. The application service corresponding to the alarm management function is used to obtain PLC data subscribed through a communication connection and the measurement point configuration information corresponding to the PLC data, and to determine the alarm conditions corresponding to the PLC data based on the measurement point configuration information; and to perform alarm analysis on the PLC data based on the alarm conditions to determine the abnormal measurement points that meet the alarm conditions. An alarm message is generated based on the abnormal measurement point, and the alarm message is pushed to the front-end device.
6. The system according to claim 5, characterized in that, The adaptation component also includes an algorithm service adaptation component; the application service corresponding to the alarm management function is further used to call the algorithm service adaptation component, send the PLC data and the measurement point configuration information corresponding to the PLC data to the algorithm service, and obtain the calculation result returned by the algorithm service; determine whether the PLC data exceeds the alarm line of the corresponding measurement point according to the calculation result, and generate the alarm information if the alarm line is exceeded.
7. A backend service method, characterized in that, The method includes: Receive business requests sent by the front-end device; Based on the business request, a target application service is determined from multiple application services corresponding to multiple business functions, and the business function corresponding to the target application service is determined as the target business function; the multiple business functions include at least two of the following: unit configuration function, measurement point configuration function, spare parts management function, trend push function, alarm management function, overview display function, and overview function; the multiple application services include application services corresponding to at least two of the following: unit configuration function, measurement point configuration function, spare parts management function, trend push function, alarm management function, overview display function, and overview function. The domain layer is invoked through the target application service so that the domain layer executes the business logic corresponding to the target business function. When the execution of the business logic corresponding to the target business function requires access to external resources, the target external resource to be accessed is determined, and the target application service calls the target adapter component in the infrastructure layer corresponding to the target external resource to access the target external resource through the target adapter component; wherein, the infrastructure layer is provided with multiple adapter components for accessing different external resources, and the multiple adapter components include at least a data storage adapter component and a communication adapter component, and the communication adapter component is used to interact with the PLC engineering service through a preset communication middleware.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in claim 7.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in claim 7.