A data transmission method for an integrated management platform and an integrated management platform.
By utilizing the data transmission method of the integrated management platform and connecting with multiple databases through the DAO layer, cross-channel data sharing and business processing are achieved, solving the problem of fragmented management systems in traditional systems and improving the service efficiency of the business processing center.
Patent Information
- Application Number
- CN202411491106.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2044-10-24
AI Technical Summary
Traditional management systems operate independently, resulting in a lack of data sharing and integration between different electronic service channels, which severely reduces the service efficiency of business processing centers.
An integrated management platform is adopted, which connects to at least two databases through the Data Access Object (DAO) layer to enable data querying and operations across multiple databases, unifies the handling of user requests by business layer methods and DAO methods, and coordinates the business logic processing of different channels.
It enables data interoperability between different electronic service channels, reduces the time spent on repetitive data input and manual coordination, and improves the service efficiency of the business processing center.
Smart Images

Figure CN119441331B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of data transmission, and in particular to a data transmission method for a comprehensive management platform and the comprehensive management platform. BACKGROUND
[0002] In the current rapidly developing digital era, enterprises and organizations are facing increasingly complex management challenges. With the expansion and diversification of business scale, for a business handling center involving different electronic service channels, the traditional management system is usually designed and implemented to solve the service activities of a certain electronic service channel. The management system of each electronic service channel is often independently developed and deployed, lacking unified standards and interfaces. For example, the management systems of mobile phone APP electronic service channel, online business hall electronic service channel, self-service terminal electronic service channel and hotline electronic service channel are independently operated, and each management system has an independent database, and the data is stored in the respective databases, which will cause the data of different electronic service channel management systems to be unable to share. For business processes that need to be handled across channels, due to the independent operation of the management systems of each electronic service channel, the data between each electronic service channel cannot be effectively shared and integrated, which will seriously reduce the service efficiency of the business handling center. SUMMARY
[0003] Embodiments of the present application provide a data transmission method for a comprehensive management platform and the comprehensive management platform, for realizing data intercommunication between multiple electronic service channels and effectively improving the service efficiency of the business handling center.
[0004] To achieve the above-mentioned purpose, the embodiments of the present application adopt the following technical solutions:
[0005] In a first aspect, a data transmission method for a comprehensive management platform is provided, applied to a server, the server being deployed with a comprehensive management platform, the comprehensive management platform including a control layer, a business layer and a data access object layer, the business layer including at least one service class, each service class including a plurality of business layer methods, the data access object layer being connected with at least two databases, the data access object layer including at least one DAO implementation class, each DAO implementation class including at least two DAO methods, the method comprising:
[0006] responding to receiving a user request sent by a user through a Bootstrap front-end interface, routing the user request to a corresponding control layer;
[0007] the control layer analyzing the user request, determining the business logic to be executed, and calling the corresponding business layer method to process the business logic through the business layer method, and determining the data operation process of the data access object layer through the business layer.
[0008] The business layer invokes a corresponding DAO method according to the data operation flow, and the DAO method includes a database query instruction;
[0009] The data access object layer determines a target database in at least two databases through the database query instruction, and performs a query operation in the target database according to the database query instruction to obtain a query result;
[0010] The data access object layer packages the query result to obtain a data encapsulation package, and returns the data encapsulation package to the Bootstrap front-end interface through the business layer and the control layer for display.
[0011] In a possible implementation manner of the first aspect, the method further includes:
[0012] In response to receiving the user request sent by the user through the Bootstrap front-end interface, a user session text file is identified;
[0013] The user identity is verified according to the user session text file, and the control authority of the user is determined according to the user session text file after the user identity verification is passed;
[0014] The corresponding control layer is determined based on the control authority, and the user request is routed to the control layer.
[0015] In another possible implementation manner of the first aspect, the method further includes:
[0016] The user session text file is parsed to obtain a session ID;
[0017] User information associated with the session ID is retrieved from a preset session storage according to the session ID;
[0018] A permission mapping list is loaded from a preset configuration file according to the user information to obtain a permission list corresponding to the user information;
[0019] An access control list is loaded, wherein the access control list includes a mapping relationship between a control layer and a permission requirement;
[0020] The permission list and the access control list are compared to obtain the control authority of the user.
[0021] In a possible implementation manner of the first aspect, the determining the corresponding control layer based on the control authority and routing the user request to the control layer comprises:
[0022] determining whether the control authority matches the authority requirement of the access control list;
[0023] in a case where the control authority matches the authority requirement of the access control list, routing the user request to the control layer.
[0024] In a possible implementation manner of the first aspect, the user request comprises a service handling request, the control layer parses the user request, determines service logic to be executed, and invokes a corresponding service layer method to process the service logic through the service layer method, and the data access object layer is determined through the service layer, comprising:
[0025] the control layer parses the service handling request, and extracts the service logic to be executed, the service logic comprising a transaction type and an interaction channel;
[0026] according to the transaction type, a corresponding service layer method is invoked;
[0027] in a case where the interaction channel is at least two, the service layer initializes a global transaction manager, and the global transaction manager is used to manage operations of all the interaction channels;
[0028] the service layer method of the service layer obtains interface data of each interaction channel, and determines an operation sequence of all the interaction channels according to the interface data of each interaction channel;
[0029] the service layer sequentially invokes services of each interaction channel according to the operation sequence, wherein the service layer records a current operation and an operation state of the interaction channel before each time the service of the interaction channel is invoked, and registers the current operation in the global transaction manager;
[0030] after the services of all the interaction channels are invoked, the service layer checks operation results of all the interaction channels through the global transaction manager, and in a case where all the operation results are successful, submits operations of all the interaction channels, and determines the data operation flow of the data access object layer through the service layer.
[0031] In a possible implementation manner of the first aspect, the service layer method of the service layer obtains interface data of each interaction channel, and determines an operation sequence of all the interaction channels according to the interface data of each interaction channel, comprising:
[0032] The service layer method acquires interface data of each interaction channel using an HTTP request, wherein the interface data comprises operation parameters, dependency relationships and operation constraints of the interaction channel;
[0033] A dependency graph of all the interaction channels is constructed according to the operation parameters, dependency relationships and operation constraints of each interaction channel;
[0034] An operation sequence of all the interaction channels is determined according to the dependency graph using a preset topological sorting algorithm.
[0035] In a possible implementation of the first aspect, after the service layer method acquires the interface data of each interaction channel using an HTTP request, the method further comprises:
[0036] The service layer determines concurrent operations of each interaction channel in a preset time period in the future according to the operation parameters and dependency relationships;
[0037] The service layer counts the number of requests of each interaction channel and calculates a concurrency according to the number of requests and the concurrent operations in the preset time period in the future;
[0038] The service layer invokes the data access object layer to store the concurrency in a Redis cache through the data access object layer, wherein the data access object layer and the Redis cache interact through a first preset interface;
[0039] In response to an AJAX request of a Bootstrap front end, the server extracts a target concurrency filtered using a preset filter from the Redis cache and displays the target concurrency using an ECharts dashboard component through the Bootstrap front end interface.
[0040] In a possible implementation of the first aspect, the data access object layer determines a target database from at least two databases through the database query instruction and performs a query operation in the target database according to the database query instruction to obtain a query result, comprising:
[0041] The data access object layer parses the database query instruction to determine a data type to be queried and a query condition, wherein the data type to be queried comprises a structured data type and an unstructured data type, and the query condition comprises a time range, a query physical address and an identifier;
[0042] In a case that the data type to be queried is the structured data type, the data access object layer determines that the target database is a relational database, and determines a target database instance in the relational database according to the query condition;
[0043] The data access object layer executes a query operation in the database instance in the relational database, and obtains a query result;
[0044] In a case that the data type to be queried is the unstructured data type, the data access object layer determines that the target database is a non-relational database, and determines a target database instance in the non-relational database according to the query condition;
[0045] The data access object layer executes a query operation in the database instance in the non-relational database, and obtains a query result.
[0046] In a case that the data type to be queried is the unstructured data type, the data access object layer determines that the target database is a non-relational database, and determines a target database instance in the non-relational database according to the query condition;
[0047] The data access object layer packs the query result, and obtains a data packaging package.
[0048] In a case that the data type to be queried is the unstructured data type, the data access object layer determines that the target database is a non-relational database, and determines a target database instance in the non-relational database according to the query condition;
[0049] The control layer is configured to analyze a user request, determine a business logic to be executed, and call a corresponding business layer method to process the business logic through the business layer method, and determine a data operation process of the data access object layer through the business layer.
[0050] The business layer is configured to call a corresponding DAO method according to the data operation process, and the DAO method includes a database query instruction.
[0051] The data access object layer is connected with at least two databases, and comprises at least one DAO implementation class, and each DAO implementation class comprises at least two DAO methods.
[0052] Through the above technical solution, the data access object layer (DAO layer) is connected with at least two databases, realizing data query and operation across multiple databases, so that the data of different electronic service channels can be accessed and managed through a unified DAO layer, thereby realizing data sharing and integration. In addition, user requests can be processed through unified business layer methods and DAO methods, so that the operations of different electronic service channels can be managed in a consistent manner. The control layer parses user requests and calls corresponding business layer methods, which can coordinate the business logic processing of different channels. The business layer method can integrate the data operation requirements of multiple channels and realize cross-database data query and operation through the DAO layer, thereby improving the efficiency of cross-channel business processing. In summary, through a unified comprehensive management platform, cross-channel data sharing and business processing are realized, solving the problem of traditional management systems being managed separately and data silos, so that data can be interchanged between different electronic service channels, thereby reducing the time of repeated data input and manual coordination and effectively improving the service efficiency of the business processing center.
[0053] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0054] Figure 1 A flowchart of a data transmission method for a comprehensive management platform provided by the embodiments of the present application;
[0055] Figure 2 An architecture diagram of a comprehensive management platform provided by the embodiments of the present application;
[0056] Figure 3 Another flowchart of a data transmission method for a comprehensive management platform provided by the embodiments of the present application. DETAILED DESCRIPTION
[0057] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. It should be understood that the specific implementation described herein is only used to explain and illustrate the embodiments of the present application, and is not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort fall within the scope of the present application.
[0058] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative positional relationship, movement condition, etc. between components in a certain specific posture (as shown in the drawings), and if the specific posture changes, the directional indications also change accordingly.
[0059] In addition, if the embodiments of the present application involve descriptions such as "first", "second", etc., the descriptions of "first", "second", etc. are only for description purposes, and cannot be understood as indicating or implying the relative importance of the indicated technical features or implicitly indicating the number of the indicated technical features. Therefore, the features limited by "first", "second" can explicitly or implicitly include at least one of the features. In addition, the technical solutions of each embodiment can be combined with each other, but it must be based on the fact that a person of ordinary skill in the art can realize it, and when the combination of technical solutions contradicts each other or cannot be realized, it should be considered that the combination of technical solutions does not exist and is not within the protection scope claimed by the present application.
[0060] Figure 1 A flowchart of a data transmission method for a comprehensive management platform according to an embodiment of the present application is schematically shown. As shown in Figure 1 The present application provides a data transmission method for a comprehensive management platform, which is applied to a server, the server is deployed with a comprehensive management platform, the comprehensive management platform includes a control layer, a business layer and a data access object layer, the business layer includes at least one service class, each service class includes a plurality of business layer methods, the data access object layer is connected with at least two databases, the data access object layer includes at least one DAO implementation class, each DAO implementation class includes at least two DAO methods, and the method can include the following steps.
[0061] S110, in response to receiving a user request sent by a user through a Bootstrap front-end interface, routing the user request to a corresponding control layer;
[0062] S120, the control layer parses the user request, determines the business logic to be executed, and calls the corresponding business layer method to process the business logic through the business layer method, and determines the data operation process of the data access object layer through the business layer.
[0063] S130, the business layer calls a corresponding DAO method according to the data operation process, and the DAO method includes a database query instruction;
[0064] S140, the data access object layer determines a target database in at least two databases through the database query instruction, and performs a query operation in the target database according to the database query instruction to obtain a query result;
[0065] S150, the data access object layer packages the query result to obtain a data encapsulation package, and returns the data encapsulation package to the Bootstrap front-end interface through the business layer and the control layer for display.
[0066] When a user sends a user request through the Bootstrap front-end interface, the server immediately responds and processes the user request. Bootstrap is a front-end framework that can provide UI components and responsive design, making the front-end interface more beautiful and easy to use. Users can trigger requests by clicking buttons, submitting forms, or other interactive ways. The request contains a specific URL path and parameters to identify the operation the user wants to perform.
[0067] Specifically, the user request is an Ajax request, where Ajax (Asynchronous JavaScript and XML) request is a technology that sends requests to the server asynchronously through JavaScript without refreshing the entire page. Ajax request can be seamlessly integrated into the Bootstrap front-end interface and allows users to interact with the server without refreshing the page. When sending an Ajax request, the browser automatically attaches a user session text file (cookie) related to the domain. Moreover, Ajax request allows asynchronous authentication and permission checking during user interaction, which can verify user identity immediately after user input is completed without waiting for form submission.
[0068] The specific process of using Ajax requests in a Bootstrap frontend interface is as follows: 1. The user performs an operation on the Bootstrap interface, such as clicking a button or submitting a form. The operation is usually bound to a JavaScript event handling function. 2. The JavaScript code creates an XMLHttpRequest object. 3. Set the request URL, method (GET, POST, etc.), headers, and other parameters. 4. Call the send method of the XMLHttpRequest object to send the request to the server. At this point, the page will not refresh or jump. 5. After the server receives the request, it executes the corresponding processing logic and returns the response. 6. When the server response returns, the XMLHttpRequest object triggers the corresponding events (such as onreadystatechange), and JavaScript can handle the returned data in these events. 7. According to the returned data, the JavaScript code can dynamically update the page content without refreshing the entire page.
[0069] After the server receives the user request, it directs the request to the corresponding control layer according to the pre-configured routing rules. The routing process is usually handled by the routing module of the web server or application server. Routing rules can determine which controller to send the request to based on URL patterns, HTTP methods (GET, POST, etc.), or other request characteristics.
[0070] After the control layer (Controller layer) receives the user request routed from the routing, it first performs request parsing. The request parsing process includes extracting various information in the request, such as URL parameters, form data, request headers, etc. After parsing, the control layer can determine the specific business logic to be executed based on the information obtained from the parsing. Business logic can include querying databases, processing user input, performing calculations, and other operations.
[0071] After determining the business logic, the Controller layer calls the corresponding business layer method. Business layer methods are usually encapsulated in service classes, and each service class can include multiple related business methods. The control layer obtains an instance of the service class through dependency injection, and then calls the required business layer method. Business layer methods are used to handle specific business logic, such as data processing, rule verification, transaction management, etc. During processing, the business layer (Service layer) determines the data operation process that needs to be executed, including which data needs to be accessed, how to access (such as query, insert, update, or delete), etc. The data operation process is used to guide the subsequent data access object layer to interact with the database. Through layered design, the control layer focuses on request processing and response generation, while delegating specific business logic to the business layer for processing, achieving separation of concerns and improving code maintainability and scalability.
[0072] The service layer, after determining the data operation flow, calls the corresponding DAO method according to the data operation flow. DAO is a design pattern that separates data persistence logic from business logic. Each DAO method corresponds to a specific database operation, such as query, insert, update, or delete. The business layer interacts with the database by calling DAO methods without directly handling underlying database connections and SQL statements. The DAO method contains specific database query instructions inside, which can be native SQL statements, ORM (Object-Relational Mapping) framework query languages, or other database access technologies. Query instructions define specific database operations to be performed, including tables, fields, conditions, etc. By using the DAO layer, the business layer can focus on the implementation of business logic without worrying about the details of specific database operations. Not only does it improve code maintainability, but it also makes it easier to replace the underlying database or data access technology, as only the DAO layer implementation needs to be modified without changing the business layer code. In addition, the DAO layer can also implement some common data access functions, such as connection pool management, transaction control, etc., further simplifying the implementation of the business layer.
[0073] After receiving the call from the business layer, the data access object layer executes the corresponding DAO method. First, according to the database query instruction, the data access object layer determines the target database in at least two connected databases. The target database can be determined according to the content and storage location of the query, etc. After determining the target database, the data access object layer establishes a connection with the database. Then, the data access object layer converts the database query instruction in the DAO method into actual SQL statements or other database-specific query languages. Next, the data access object layer executes the query operation on the target database. After the query is executed, the target database returns the query result. The data access object layer receives the query result.
[0074] The data access object layer packages the query results after obtaining them, generating a data encapsulation package. The encapsulation process can be the conversion of the original results returned by the database into objects or data structures used in the application. For example, the query results can be mapped to Java objects, JSON structures, or other custom data formats. The generated data encapsulation package contains all the relevant information of the query results to facilitate subsequent processing and display. Then, the data encapsulation package is returned level by level. First, it is passed back to the business layer, which can further process or combine the data, such as merging multiple query results, applying business rules, etc. Next, the processed data is passed to the control layer. The control layer is used to convert the data into a format suitable for front-end display. Finally, the control layer sends the processed data back to the Bootstrap front-end interface. After receiving the data, the front-end uses Bootstrap components and JavaScript to parse and display the data.
[0075] In summary, Figure 3 Another flowchart of a data transmission method for a comprehensive management platform is shown in the embodiment of the present application, as shown in Figure 3 The Bootstrap front-end interface provides a visual and responsive interactive environment for users. When a user performs an operation on the Bootstrap front-end interface, such as clicking a button or submitting a form, a predefined JavaScript event handling function is triggered, which creates and sends an Ajax request to communicate with the server asynchronously without refreshing the entire page. The Ajax request carries relevant data of the user's operation, such as query parameters or form content, and sends it to the server through the HTTP protocol. After receiving the request, the server is first processed by the web server, and then the request is forwarded to the Controller layer of the comprehensive management system. The Controller layer is used to parse request parameters, verify user identity and permissions, and determine the business logic to be executed according to the request URL and method. After determining the business logic, the Controller layer calls the corresponding Service layer method. The Service layer encapsulates the core business logic and is responsible for coordinating and organizing various business operations.
[0076] The Service layer calls the DAO layer to perform specific data operations when executing business logic. The DAO layer focuses on data persistence operations and encapsulates direct interaction logic with the database, which is used to convert business objects into query statements or commands that the database can understand and execute query operations.
[0077] The DAO layer connects with the database through a database connection pool to execute SQL queries or update operations. Depending on the operation type, it can be retrieving data from the database or writing new data records to the database. After execution, the DAO layer converts the database returned results into business objects (data encapsulation package) and returns them along the call chain upwards.
[0078] Finally, the processing result is packaged into an HTTP response by the Controller layer and sent back to the client. After receiving the response, the Ajax request parses the returned data and updates the corresponding part of the page accordingly, completing the entire request-response cycle. Specifically, the architecture diagram of the comprehensive management platform is as shown in Figure 2
[0079] The embodiment connects with at least two databases through the data access object layer (DAO layer) to realize cross-database data query and operation, so that the data of different electronic service channels can be accessed and managed through the unified DAO layer, thereby realizing data sharing and integration. In addition, processing user requests through unified business layer methods and DAO methods can ensure that the operations of different electronic service channels can be managed in a consistent manner. By parsing user requests through the control layer and calling corresponding business layer methods, the business logic processing of different channels can be coordinated. The business layer method can integrate the data operation requirements of multiple channels and realize cross-database data query and operation through the DAO layer, thereby improving the efficiency of cross-channel business processing. In summary, through the unified comprehensive management platform, cross-channel data sharing and business processing are realized, solving the problem of traditional management systems being self-governed and data silos, so that the data of different electronic service channels can be interconnected, thereby reducing the time of repeated data input and manual coordination and effectively improving the service efficiency of the business processing center.
[0080] In one implementation of the embodiment, in response to receiving a user request sent by a user through a Bootstrap front-end interface, the user request is routed to a corresponding control layer, including the following steps:
[0081] S210, in response to receiving a user request sent by a user through a Bootstrap front-end interface, a user session text file is identified;
[0082] S220, verifying the user's identity according to the user session text file, and determining the user's control authority according to the user session text file after the user's identity is verified;
[0083] S230, determining the corresponding control layer based on the control authority, and routing the user request to the control layer.
[0084] When a user sends a request through the Bootstrap frontend interface, the server first needs to identify and obtain the user's session text file, which is the cookie. Specifically, when the user's browser sends an HTTP request, it automatically attaches all cookies related to the website to the request header. After the server receives the request, it parses the HTTP header and extracts the Cookie field. The Cookie field usually contains multiple key-value pairs, each representing a specific cookie information. The server needs to iterate through all key-value pairs to find the specific cookie related to the user's session. This specific session cookie usually contains a unique session identifier, which can be a randomly generated string or encrypted user information.
[0085] In actual implementation, the process can be automated using the functions provided by the web server's middleware or framework. For example, in a Java Servlet container, the HttpServletRequest's getCookies() method can be used to obtain all cookies. After obtaining the cookies, they need to be parsed and verified. First, check the integrity of the cookie to ensure it has not been tampered with. Then, verify the validity period of the cookie to ensure it has not expired. If the cookie has expired or does not exist, a new session cookie may need to be created.
[0086] After obtaining the user's session text file (cookie), the user's identity is verified and the user's control authority is determined based on the cookie. This process usually consists of two main stages: identity verification and authority determination. First, for identity verification, the identity information contained in the cookie is first parsed. The identity information can be an encrypted user ID, a session token, or other forms of identity identifiers. Then, the identifier is compared with the user session data stored in the backend database or cache. The verification process can include checking if the session has expired, verifying the validity of the session token, confirming the user account status, etc.
[0087] In actual implementation, various identity verification mechanisms can be adopted. For example, if JWT is used, the server will parse the token, verify its signature, and check the claims (such as expiration time, issuer, etc.) contained in it. If the verification fails, the server can require the user to log in again or return an error message. If the verification is successful, the server will extract user information such as user ID, role, etc. from the token.
[0088] After authentication, the server determines the user's control permissions based on the user information. The server queries the user's role, organization, department, and other user information stored in the cookie. Then, the server matches the user information with predefined permission rules to determine the resources the user can access and the operations the user can perform. In implementation, permission management frameworks such as Spring Security (Java) or Casbin (Go) can be used to define and manage these permission rules. Permissions can include page access permissions, data operation permissions, function usage permissions, etc. To improve efficiency, the server can use caching to store the user's permission information, avoiding the need to recalculate permissions for each request.
[0089] After determining the user's control permissions, the server determines the corresponding control layer based on the control permissions and routes the user's request to the corresponding control layer. Specifically, the server compares the user's control permissions with the requested resources and operations, and checks whether the user has the permission to access the requested resources and perform the corresponding operations. If the user does not have sufficient permissions, the server can reject the request, return a 403 Forbidden error, or redirect to an error page.
[0090] In this embodiment, there are multiple control layers, each responsible for handling specific types of requests or business logic in specific areas. The server can select the corresponding control layer based on the user's permission level. For example, for users with administrator permissions, the server can route to the administrator control layer with more functions; for ordinary users, it may route to the standard control layer with limited functions.
[0091] This embodiment controls permissions at the routing level, so the server can intercept unauthorized access before the request reaches the business logic layer, improving the efficiency and security of the server.
[0092] In one embodiment of the present embodiment, the user's control permissions are determined according to the user session text file, including the following steps:
[0093] S310, parsing the user session text file to obtain the session ID;
[0094] S320, according to the session ID, retrieving the user information associated with the session ID in the preset session storage;
[0095] S330, according to the user information, loading the permission mapping list in the preset configuration file to obtain the permission list corresponding to the user information;
[0096] S340, loading the access control list, wherein the access control list includes the mapping relationship between the control layer and the permission requirement;
[0097] S350, compare the permission list with the access control list to obtain the control permission of the user.
[0098] In web applications, cookies are typically stored in the "Cookie" field of the request header as key-value pairs. The process of parsing the user session text file requires traversing the key-value pairs to find the specific cookie representing the session ID. The session ID is a unique string, which can be a randomly generated UUID (Universal Unique Identifier) or an encrypted user-related information.
[0099] According to the parsed session ID, the user information associated with the ID is retrieved from the preset session storage. The session storage can be an in-memory database (such as Redis), a relational database (such as MySQL), or a distributed cache system. In actual implementation, a connection to the session storage needs to be established first. During the query process, the session ID is used as the key to retrieve the corresponding user information. The user information can include user ID, username, role, last login time, and other key data.
[0100] To improve performance, a caching strategy can be adopted. For example, a cache of session information can be maintained in the local memory of the application server to reduce the access frequency to external storage. At the same time, a cache invalidation mechanism needs to be implemented to ensure that the data in the cache is synchronized with the data in the storage.
[0101] According to the retrieved user information, load the permission mapping list in the preset configuration file to obtain the permission list corresponding to the user information. Specifically, the permission mapping list defines the correspondence between user roles or specific attributes and system permissions. The configuration file can be in formats such as XML, JSON, YAML, or structured data stored in a database.
[0102] In actual implementation, the configuration file needs to be read and parsed first. If the file is stored, the file I / O and parsing library of the corresponding programming language can be used to read the file content. For example, for a JSON format configuration file, JSON.parse() (JavaScript) or jackson library (Java) can be used for parsing. If the configuration is stored in a database, a database query needs to be performed to obtain the permission mapping information.
[0103] After parsing, the corresponding permission list is found in the permission mapping according to the user's role or attribute. In specific implementation, a permission caching mechanism can be used to cache frequently accessed permission information in memory, reducing the number of times the configuration file is read.
[0104] Access Control List (ACL) defines the mapping between various control layers (such as specific API endpoints, pages or functional modules) in the system and the required permissions. Access Control List contains detailed permission rules, which specify the permission level or specific permission required to access a specific resource or perform a specific operation.
[0105] In actual implementation, ACL can take various storage forms. Common ways include configuration files (such as XML, JSON, YAML), database tables, or direct definition in code through annotations or specific data structures.
[0106] Compare the user's permission list with the Access Control List (ACL) to determine the user's actual control permissions. Specifically, each item in the user's permission list can be compared with the permission requirements defined in the ACL. In the actual comparison process, when there is a conflict between the permissions obtained by the user from different sources, the conflict resolution strategy can be the "least privilege principle" (intersection) or the "maximum privilege principle" (union).
[0107] This embodiment can maintain the user's session state based on the stateless HTTP protocol by accurately parsing the session ID, achieving user identity persistence and cross-request data transmission. Not only does it improve user experience, allowing users to log in without having to do so every time they request, but it also provides a foundation for implementing more complex user authentication and authorization mechanisms. In addition, by efficiently and securely retrieving user information, the user's identity can be quickly identified while protecting the security of user data. This allows the user to maintain a logged-in state between multiple requests, improving user experience, and through the permission list, the user's permissions can be dynamically adjusted based on their identity and attributes, effectively preventing unauthorized access and providing a flexible permission management mechanism.
[0108] In one embodiment of the present embodiment, the corresponding control layer is determined based on the control permission, and the user request is routed to the control layer, including the following steps:
[0109] S410, determine whether the control permission matches the permission requirements of the access control list;
[0110] S420, in the case where the control permission matches the permission requirements of the access control list, route the user request to the control layer.
[0111] In this embodiment, the user's control permissions are first compared in detail with the permission requirements of the access control list to determine whether the user has the right to perform a specific operation or access a specific resource. In actual operation, each resource or operation involved in the user's request can be checked one by one and matched with the permission requirements defined in the access control list. The user's permissions and the resource's permission requirements can be encoded into bitmaps, and then the requirements can be quickly determined through bitwise operations.
[0112] After confirming that the control authority of the user matches the authority requirement of the access control list, the user request is routed to the corresponding control layer. A routing table or routing configuration can be maintained to map different request patterns to corresponding control layers. This mapping can be statically defined or dynamically generated.
[0113] This embodiment ensures that each request is processed by the corresponding component by accurately directing the user request to the control layer with the authority to handle it, ensuring strict access control and improving request processing efficiency. Not only can unauthorized access and unauthorized operations be prevented, but scalability and flexibility can also be improved.
[0114] In one embodiment of the present embodiment, the user request includes a service handling request, the control layer parses the user request, determines the service logic to be executed, and calls the corresponding service layer method to process the service logic through the service layer method. The data access object layer determines the data operation process through the service layer, including the following steps:
[0115] S510, the control layer parses the service handling request and extracts the service logic to be executed, which includes the transaction type and the interaction channel;
[0116] S520, according to the transaction type, call the corresponding service layer method;
[0117] S530, in the case of at least two interaction channels, the service layer initializes a global transaction manager, which is used to manage the operations of all interaction channels;
[0118] S540, the service layer method of the service layer obtains the interface data of each interaction channel, and determines the operation sequence of all interaction channels according to the interface data of each interaction channel;
[0119] S550, the service layer calls the services of each interaction channel in turn according to the operation sequence, wherein the service layer records the current operation and operation state of the interaction channel before each call to the service of the interaction channel, and registers the current operation in the global transaction manager;
[0120] S560, after the services of all interaction channels are called, the service layer checks the operation results of all interaction channels through the global transaction manager, and submits the operations of all interaction channels in the case that all operation results are successful, and determines the data operation process of the data access object layer through the service layer.
[0121] In this embodiment, first, the control layer receives a service handling request sent by the user, and the service handling request arrives in the form of an HTTP request or other network protocol packet. The parsing process includes analysis of the request header and request body. The request header can include metadata such as content type, request method, user agent, etc., and the request body includes specific service data.
[0122] The parsing process uses specific parsers to select the target parsing strategy according to the content type of the request (such as JSON, XML, Form Data, etc.). For example, for a JSON format request, a JSON parsing library can be used to convert the string into a structured object; for XML, a DOM or SAX parser can be used. When extracting business logic, the system will identify and extract key information from the parsed data according to the predefined data model or protocol specification. This includes transaction type (which can be an enumeration value or a string identifier), user ID (a unique identifier), transaction amount, and interaction channel (which can be one or more identifiers).
[0123] After that, the corresponding business layer method is called according to the transaction type. In the actual calling process, first, according to the extracted transaction type, the corresponding business layer method is found in the mapping table. Hash lookup or index lookup, etc. can be used. After determining the corresponding business layer method, the method is dynamically called. The method object can be dynamically obtained according to the method name, and the necessary parameters are passed in for calling.
[0124] In the case of at least two interaction channels, the business layer initializes a global transaction manager, which is used to coordinate and manage operations across multiple interaction channels, ensuring that all operations are successful or all operations fail, thereby maintaining data consistency.
[0125] The initialization process first involves creating an instance of the global transaction manager. The instance of the global transaction manager is a singleton object responsible for managing the lifecycle of the entire transaction. The implementation of the global transaction manager can be based on distributed transaction protocols such as the two-phase commit protocol (2PC) or the three-phase commit protocol (3PC). When initializing, the global transaction manager needs to establish connections with each interaction channel.
[0126] The global transaction manager is used to maintain a transaction context for tracking the status and participants (i.e. each interaction channel) of the current transaction. The context can contain transaction ID, start time, participant list, current state, etc. The manager is also used to implement transaction boundary control, including the ability to start a transaction, commit a transaction, and roll back a transaction.
[0127] In a multi-channel scenario, the manager can use distributed locks or other concurrency control mechanisms to ensure that operations between multiple channels do not interfere with each other.
[0128] After that, the business layer method obtains the interface data of each interaction channel and determines the operation sequence. First, the business layer method traverses all the involved interaction channels and obtains the corresponding interface data for each channel. The interface data can include the processing capacity of the channel, the current load, the response time, the operation complexity, and other information.
[0129] To improve efficiency, parallel requests or asynchronous calls can be used to obtain data from multiple channels simultaneously. After obtaining the interface data of all channels, the operation sequence can be determined according to predefined rules or algorithms.
[0130] The business layer calls the services of each interaction channel in turn according to the operation sequence and records the operation status and registers the current operation before each call, which can ensure the reliability and traceability of multi-channel operation. First, the business layer will call the services of each interaction channel one by one according to the operation sequence. Before each call, a series of preparation work needs to be performed. This includes recording the detailed information of the current operation, such as operation type, target channel, input parameter, etc. A state machine can be maintained to track the life cycle of each operation. Common states can include "preparing", "executing", "completed", "failed", etc. The change of state needs to be recorded in time and can trigger corresponding events or notifications.
[0131] Registering the current operation in the global transaction manager is the key to implementing distributed transactions. The registration process includes adding operation information to the transaction context, obtaining transaction locks or setting transaction boundaries to ensure that the operation can be correctly included in the management scope of the global transaction, and preparing for subsequent commit or rollback.
[0132] After the services of all interaction channels are called, the business layer checks all operation results through the global transaction manager and decides whether to commit the operation. First, the business layer needs to obtain the execution results of all registered operations from the global transaction manager. After obtaining all operation results, consistency checking is needed. This includes verifying the execution status of each operation, checking whether the operation result meets the expectations, and evaluating the integrity of the overall business logic. If all operation results are successful and pass the consistency check, the entire transaction is committed. The commit process usually follows the two-phase commit protocol: first, send the prepare to commit instruction to all participants, and after receiving the prepare ready response from all participants, send the final commit instruction. When committing the operation, the related business status and data need to be updated. This includes updating database records, sending confirmation messages, triggering subsequent business processes, etc. All the above operations need to be performed under the protection of the transaction to ensure data consistency.
[0133] If any exception or failure is found during the checking process, the rollback process needs to be started. The rollback process needs to undo the executed operations.
[0134] The embodiment can maintain the correctness of the business logic in a complex multi-channel environment through comprehensive result checking and strict submission control. Meanwhile, strong support is provided for fault recovery and exception handling, thereby enhancing the reliability and stability of the system.
[0135] In one of the embodiments of the present embodiment, the business layer method of the business layer obtains interface data of each interaction channel, and determines the operation sequence of all interaction channels according to the interface data of each interaction channel, including the following steps:
[0136] S610, the business layer method obtains the interface data of each interaction channel using an HTTP request, wherein the interface data includes operation parameters, dependency relationships and operation constraints of the interaction channel;
[0137] S620, a dependency relationship graph of all interaction channels is constructed according to the operation parameters, dependency relationships and operation constraints of each interaction channel;
[0138] S630, a preset topological sorting algorithm is used to determine the operation sequence of all interaction channels according to the dependency relationship graph.
[0139] The business layer method obtains the interface data of each interaction channel through an HTTP request. In specific implementation, first, the interface addresses of all interaction channels need to be determined. The interface addresses are usually stored in the form of URLs in a configuration file or a database. Then, the business layer method sends an HTTP GET request to each address one by one. After the request is sent, the server returns a response containing interface data. The response data is usually in JSON or XML format, which contains key information such as operation parameters, dependency relationships and operation constraints of the interaction channel.
[0140] The operation parameters can include attributes such as identifier, name, type, processing capacity of the interaction channel. The dependency relationship represents the precondition of the operation sequence of the interaction channel, that is, the channel that needs to be completed first. The operation constraint can include time limit, resource requirement and other conditions. After obtaining the above data, the business layer method will parse and structure the data, and convert the JSON or XML format into a data structure that can be directly used in the program, such as object or dictionary.
[0141] After obtaining the interface data of each interaction channel, a dependency relationship graph of all interaction channels is constructed. First, a suitable data structure is selected to represent the dependency relationship graph. Usually, an adjacency list or an adjacency matrix can be used to represent the graph structure. In the present embodiment, the adjacency list is used to represent the graph structure, which is more space-saving and easier to traverse.
[0142] The process of constructing a dependency graph is as follows: First, create an empty graph structure, where each node represents an interaction channel. Then, traverse the interface data of each interaction channel. For each interaction channel, add corresponding edges to the graph based on its dependency information. For example, if channel A depends on channel B, add a directed edge from B to A in the graph.
[0143] Once the graph is built, it can be validated to check for circular dependencies. Circular dependencies prevent the generation of a valid order of operations. If a circular dependency is detected, a warning is issued along with specific information about the dependency, allowing administrators to intervene and make adjustments.
[0144] After constructing the dependency graph, a pre-defined topological sorting algorithm is used to determine the operation order of all interaction channels based on the dependency graph. Topological sorting is a sorting algorithm for directed acyclic graphs (DAGs). It arranges the nodes in the graph into a linear sequence such that all directed edges point from the beginning to the end of the sequence. The process is as follows:
[0145] 1. Initialize a queue Q and add all nodes with an in-degree of 0 (i.e., no dependent interaction channels) to the queue.
[0146] 2. Initialize a list L to store the final sorting results.
[0147] 3. When queue Q is not empty, repeat the following steps: a. Remove a node n from Q and add it to list L. b. For each adjacent node m of node n: remove the edge (n, m) from the graph. If the in-degree of m becomes 0, add m to queue Q.
[0148] 4. If edges still exist in the graph, it means there is a cycle in the graph, and topological sorting cannot be completed. Otherwise, the order in L is the desired order of operations.
[0149] In practical applications, operational constraints also need to be considered. For example, if some interaction channels have time limits, the node with the tightest time limit can be prioritized when selecting the next node. If there are resource requirement constraints, resource allocation checks can be performed during the sorting process to ensure that resource usage at any given time does not exceed the system capacity.
[0150] The effect of this step is to generate an interaction channel operation sequence that satisfies all dependencies and operational constraints. This sequence ensures that during execution, each interaction channel's operation is performed only after all its dependencies have been completed, thus avoiding potential conflicts and errors. Furthermore, by considering time and resource constraints, the generated sequence also optimizes overall operational efficiency and maximizes the utilization of system resources.
[0151] This implementation generates an interaction channel operation sequence that satisfies all dependencies and operational constraints, ensuring that during execution, the operation of each interaction channel is performed only after all its dependencies have been completed, thereby avoiding potential conflicts and errors.
[0152] In one embodiment of this example, after the business layer method uses an HTTP request to obtain the interface data for each interaction channel, the following steps are also included:
[0153] S710, the business layer method determines the concurrent operations of each interaction channel within a preset time period based on operation parameters and dependencies;
[0154] S720: The business layer counts the number of requests for each interaction channel and calculates the concurrency based on the number of requests and the concurrent operations within a preset time period.
[0155] S730, the business layer calls the data access object layer to store the concurrency in the Redis cache through the data access object layer. The data access object layer and the Redis cache interact through the first preset interface.
[0156] S740: In response to AJAX requests from the Bootstrap frontend, the server retrieves the target concurrency from the Redis cache after filtering with a preset filter, and displays the target concurrency through the Bootstrap frontend interface using the ECharts dashboard component.
[0157] After acquiring the interface data for each interaction channel, the business layer method determines the concurrent operations for each interaction channel within a preset time period based on the operation parameters and dependencies. Specifically, first, the acquired operation parameters are analyzed, and then, combined with dependencies, a time series model is constructed. The time series model is built based on historical data, seasonal factors, and the mutual influences between various interaction channels.
[0158] In practice, time series analysis methods, such as the ARIMA (Autoregressive Integrated Moving Average) model, can be used to predict concurrent operations within a preset time period by combining historical data trends and periodicity with current operating parameters and dependencies. The preset time period can be hours, days, or weeks.
[0159] The impact of dependencies can be considered during the prediction process. For example, if channel A depends on channel B, then the prediction of concurrent operations of channel A needs to take into account the prediction results of channel B. Dependencies can be handled graphically, using a directed acyclic graph (DAG) to represent dependencies, and then predictions are performed in topological order.
[0160] After determining the predicted concurrent operations within a pre-defined time period, the business layer begins to count the number of requests for each interaction channel and calculates the concurrency based on the number of requests and the predicted concurrent operations. A pre-defined real-time monitoring system can capture and record requests for each interaction channel. This real-time monitoring system can be implemented by setting a counter at the entry point of each interaction channel; each time a new request arrives, the corresponding counter will increment.
[0161] Concurrency is equal to request arrival rate multiplied by average processing time. Request arrival rate can be derived from the number of requests, while average processing time can be estimated from historical data and predicted concurrent operations.
[0162] After calculating the concurrency level, the business layer calls the data access object layer to store the concurrency level in the Redis cache. First, the business layer calls the data access object layer through a predefined interface. The data access object layer, as an abstraction layer, encapsulates all data storage-related operations and provides a unified interface for the business layer. The interaction between the data access object layer and the Redis cache is through a first predefined interface. This first predefined interface defines a series of operations, including setting key-value pairs, retrieving values, and setting expiration times. When storing the concurrency level, a hash structure can be used to organize the data. For example, the identifier of the interaction channel can be used as the key, and information such as the concurrency level and timestamp can be stored as field-value pairs in the hash.
[0163] Finally, in response to the Bootstrap frontend's AJAX request, the target concurrency level, filtered by a preset filter, is retrieved from the Redis cache and displayed using the ECharts dashboard component through the Bootstrap frontend interface.
[0164] First, the Bootstrap frontend sends a request to the server via AJAX. AJAX allows updating parts of a webpage without refreshing the entire page, providing a better user experience. Upon receiving the request, the server reads concurrent data from the Redis cache. During this process, preset filters are used to filter and process the data. Filters can remove outliers, smooth data, and select data within specific time ranges, among other things.
[0165] The filtered target concurrent data is returned to the frontend via an HTTP response. Upon receiving the data, the frontend uses the ECharts library to create a visual dashboard component. ECharts is an open-source visualization library that supports various chart types, including dashboards. During implementation, the appearance and behavior of the dashboard can be customized by configuring ECharts' option objects. For example, the dashboard's scale, color range, and pointer style can be set.
[0166] To achieve real-time updates, a timer can be set up on the front end to periodically send AJAX requests to retrieve the latest data. Additionally, ECharts' animation effects can be used to smoothly update the dashboard display, providing a better visual experience.
[0167] In the Bootstrap front-end interface, Bootstrap's grid system can be used to layout multiple ECharts dashboards to simultaneously display the concurrent traffic of multiple interaction channels. Furthermore, interactive features can be added, including allowing users to select different time ranges or interaction channels for viewing.
[0168] This implementation method can intuitively display the system's concurrency on the user interface. Through the real-time updated dashboard, administrators can quickly grasp the platform's operating status and promptly identify potential problems.
[0169] In one embodiment of this example, the data access object layer determines the target database from at least two databases using a database query instruction, and performs a query operation in the target database according to the database query instruction to obtain the query result, including the following steps:
[0170] S810, The data access object layer parses the database query instruction, determines the data type to be queried and the query conditions. The data type to be queried includes structured data types and unstructured data types, and the query conditions include time range, query physical address and identifier.
[0171] S820. When the data type to be queried is a structured data type, the data access object layer determines that the target database is a relational database and determines the target database instance in the relational database according to the query conditions.
[0172] S830, The data access object layer performs query operations in the database instance of the relational database and obtains the query results;
[0173] S840. When the data type to be queried is an unstructured data type, the data access object layer determines that the target database is a non-relational database and determines the target database instance in the non-relational database according to the query conditions.
[0174] S850, the data access object layer performs query operations in a database instance of a non-relational database and obtains the query results.
[0175] The data access object layer first needs to parse the database query command. The purpose of parsing is to extract two key pieces of information from the query command: the data type to be queried and the query conditions. The data type to be queried is divided into structured data types and unstructured data types to determine the type of database to be used subsequently. The query conditions include the time range, the physical address to be queried, and identifiers (such as user IDs).
[0176] Regular expressions or dedicated SQL parsing libraries can be used to process query commands. For time ranges, you can search for patterns like "BETWEEN '2023-01-01' AND '2023-12-31'"; for physical addresses, you can search for fields containing address keywords; for identifiers, you can search for patterns like "user_id = '12345'".
[0177] When determining the data type, you can analyze the target table or fields of the query. For example, if the query involves a table with a predefined structure, it can be determined as a structured data type; if the query involves JSON fields or full-text search, it can be determined as an unstructured data type.
[0178] When the data type to be queried is determined to be a structured data type, the data access object layer will determine the target database as a relational database. This selection process is based on the characteristics of structured data, namely that the data has a predefined schema, making it suitable for storage and querying in tabular form. Common relational databases include MySQL, PostgreSQL, and Oracle.
[0179] Once the target database is determined, the specific database instance is then selected based on the query criteria. The data is distributed across multiple database instances to improve performance and scalability.
[0180] This embodiment can use a preset algorithm to determine the target database instance. The preset algorithm calculates a hash value based on keywords in the query conditions (such as user ID), and then maps this hash value to a database instance ring. This ensures that the same query conditions are always routed to the same database instance, thereby improving caching efficiency and query performance.
[0181] Once the target relational database instance is identified, the data access object layer begins executing specific query operations within that instance. First, the data access object layer needs to construct SQL statements based on the parsed query conditions. Parameterized queries can be used to prevent SQL injection attacks. For example, prepared statements and placeholders can be used instead of directly concatenating SQL strings.
[0182] Next, you can use database execution plan tools to analyze the performance of SQL statements and perform necessary optimizations. Common optimization techniques include adding appropriate indexes, avoiding LIKE statements that start with wildcards, and using EXPLAIN statements to analyze query plans.
[0183] Using a database connection pool can reduce the overhead of creating and destroying connections when executing queries, thus improving query efficiency. Parameters such as the minimum and maximum number of connections in the connection pool, as well as the connection's lifespan, can be set to suit different load conditions.
[0184] Once the query is executed, the results will be returned. Specifically, the query results are objects that the application can use.
[0185] When the data type to be queried is determined to be unstructured, the data access object layer will identify the target database as a NoSQL database. This means the data does not have a fixed schema and may contain various formats such as text, images, and audio. After determining to use a NoSQL database, the specific database instance is determined based on the query conditions. In practice, content-based routing strategies can be employed. For example, for document-oriented databases like MongoDB, the data storage location can be determined based on a key field of the document. For key-value stores like Redis, a consistent hashing algorithm can be used to distribute data. For column-family stores like Cassandra, the data location can be determined based on the partition key.
[0186] After identifying the target NoSQL database instance, the Data Access Object (DAO) layer begins executing specific query operations within that instance. Unlike the query process for relational databases, appropriate query methods are required depending on the type of NoSQL database.
[0187] Specifically, for document-oriented databases (such as MongoDB), queries typically use a JSON-like query language. A query object can be constructed, specifying the fields and values to match. For example, you can use the form `{field: value}` to find the value of a specific field, or `{field: {$gt: value}}` for a range query. For key-value stores (such as Redis), query operations are relatively simple, usually retrieving values directly from the key. For column-family stores (such as Cassandra), queries require consideration of the data model design. For search engines (such as Elasticsearch), queries can use a DSL (Domain Specific Language) to construct complex search criteria, supporting advanced features such as full-text search, fuzzy matching, and geolocation search.
[0188] This implementation method intelligently parses query commands, dynamically selects appropriate database types and instances, and employs targeted query optimization strategies, significantly improving the efficiency and flexibility of data access. It not only addresses diverse data needs but also ensures high system performance and scalability.
[0189] In one embodiment of this invention, the data access object layer packages the query results to obtain a data package, including the following steps:
[0190] S910, The DAO method of the Data Access Object layer creates a target data transmission object based on the query results to encapsulate the query results and obtain a data encapsulation package.
[0191] In this embodiment, the DAO method in the Data Access Object layer creates a Target Data Transfer Object (DTO) based on the query results to encapsulate the query results and obtain a data package. First, the DAO method receives the raw query results returned from the database. The query results can be a ResultSet, a collection of documents (such as a MongoDB cursor), or a list of key-value pairs (such as Redis return values). Next, the DAO method creates one or more Data Transfer Objects (DTOs). A DTO is a design pattern used to transfer data between different layers. Its main purpose is to reduce the number of method calls by combining multiple related data items into a single object to improve efficiency. A DTO is typically a simple Plain Old Java Object (POJO) containing only attributes and corresponding getter / setter methods, without any business logic.
[0192] During the creation of a DTO, data mapping is required, which involves converting database field names into Java object property names. For example, a database field name might be `snake_case` (e.g., `user_name`), while a Java object property name is typically `camelCase` (e.g., `userName`).
[0193] During the encapsulation process, data type conversion needs to be considered. For example, date types in the database may need to be converted to Java's Date or LocalDateTime objects. Numeric types may require precision conversion. Finally, the created DTO objects or collections of DTO objects are encapsulated into a unified data wrapper. The data wrapper can contain metadata (such as the total number of records, pagination information), status information (such as whether the query was successful), and the actual data payload. Using a unified encapsulation format can simplify the processing logic of upper-layer applications and improve code maintainability.
[0194] This implementation achieves efficient conversion and encapsulation of query results into data transfer objects (DTOs) through the DAO method of the Data Access Object layer. It not only solves the problem of inconsistent result formats returned by different databases but also optimizes data organization and transmission by creating a suitable DTO structure. The use of DTOs reduces unnecessary data transmission, lowers network load, and provides clear interface definitions between different layers. This enables the Data Access Object layer to provide unified, efficient, and secure data access services to upper-layer applications, greatly simplifying application development and maintenance.
[0195] Reference Figure 2 and Figure 3 This application also provides an integrated management platform, including:
[0196] The control layer is used to parse user requests, determine the business logic to be executed, and call the corresponding business layer methods to process the business logic through the business layer methods. It also determines the data operation flow of the data access object layer. The user request is obtained by the server routing the user request sent by the user through the Bootstrap front-end interface.
[0197] The business layer is used to call the corresponding DAO methods according to the data operation process. The DAO methods include database query instructions. The business layer includes at least one service class, and each service class includes multiple business layer methods.
[0198] The Data Access Object (DAO) layer is used to determine the target database from at least two databases through database query commands, execute query operations in the target database according to the database query commands, obtain query results, package the query results into a data package, and return the data package to the Bootstrap front-end interface for display through the business layer and control layer. The DAO layer is connected to at least two databases and includes at least one DAO implementation class, each of which includes at least two DAO methods.
[0199] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0200] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0201] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0202] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0203] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0204] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0205] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0206] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0207] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A data transmission method for a comprehensive management platform, characterized in that, The application is applied to a server, wherein the server is deployed with an integrated management platform, the integrated management platform comprises a control layer, a business layer and a data access object layer, the business layer comprises at least one service class, each service class comprises a plurality of business layer methods, the data access object layer is connected with at least two databases, the data access object layer comprises at least one DAO implementation class, each DAO implementation class comprises at least two DAO methods, and the methods comprise: In response to receiving a user request sent by a user through a Bootstrap front-end interface, the user request is routed to a corresponding control layer, wherein the user request comprises a business handling request; The control layer analyzes the business handling request and extracts a business logic to be executed, the business logic comprising a transaction type and an interaction channel; According to the transaction type, a corresponding business layer method is called; In the case that the interaction channel is at least two, the business layer initializes a global transaction manager, which is used to manage the operations of all the interaction channels; The business layer method of the business layer obtains interface data of each interaction channel, and determines the operation sequence of all the interaction channels according to the interface data of each interaction channel; The business layer sequentially calls the services of each interaction channel according to the operation sequence, wherein the business layer records the current operation and operation state of the interaction channel before each call of the service of the interaction channel, and registers the current operation in the global transaction manager; After the services of all the interaction channels are called, the business layer checks the operation results of all the interaction channels through the global transaction manager, and submits the operations of all the interaction channels in the case that all the operation results are successful, and determines the data operation flow of the data access object layer through the business layer; The business layer calls the corresponding DAO method according to the data operation flow, and the DAO method comprises a database query instruction; The data access object layer determines a target database in at least two databases through the database query instruction, and performs a query operation in the target database according to the database query instruction to obtain a query result; The data access object layer packages the query result to obtain a data packaging package, and returns the data packaging package to the Bootstrap front-end interface through the business layer and the control layer for display.
2. The method of claim 1, wherein, In response to receiving a user request sent by a user through a Bootstrap front-end interface, a user session text file is identified; According to the user session text file, the user identity is verified, and the control authority of the user is determined according to the user session text file after the user identity verification is passed; Based on the control authority, a corresponding control layer is determined, and the user request is routed to the control layer. 3. The method of claim 2, wherein, The control permission of the user is determined according to the user session text file, and the control permission comprises: The user session text file is parsed to obtain a session ID; User information associated with the session ID is retrieved from a preset session storage according to the session ID; A permission list corresponding to the user information is obtained by loading a permission mapping list in a preset configuration file according to the user information; An access control list is loaded, wherein the access control list comprises a mapping relationship between a control layer and a permission requirement; The permission list is compared with the access control list to obtain the control permission of the user.
4. The method of claim 3, wherein, The control layer corresponding to the control permission is determined based on the control permission, and the user request is routed to the control layer, and the control layer comprises: It is determined whether the control permission matches the permission requirement of the access control list; In the case that the control permission matches the permission requirement of the access control list, the user request is routed to the control layer.
5. The method of claim 1, wherein, The business layer method of the business layer obtains interface data of each interaction channel, and determines an operation sequence of all the interaction channels according to the interface data of each interaction channel, and the operation sequence comprises: The business layer method uses an HTTP request to obtain interface data of each interaction channel, wherein the interface data comprises operation parameters, dependency relationships and operation constraints of the interaction channel; A dependency relationship graph of all the interaction channels is constructed according to the operation parameters, the dependency relationships and the operation constraints of each interaction channel; A preset topological sorting algorithm is used to determine the operation sequence of all the interaction channels according to the dependency relationship graph.
6. The method of claim 5, wherein, After the business layer method uses an HTTP request to obtain interface data of each interaction channel, the method further comprises: The business layer method determines concurrent operations of each interaction channel in a future preset time period according to the operation parameters and the dependency relationships; The business layer counts the number of requests of each interaction channel, and calculates a concurrency according to the number of requests and the concurrent operations in the future preset time period; The business layer calls the data access object layer to store the concurrency in a Redis cache through the data access object layer, wherein the data access object layer and the Redis cache interact through a first preset interface; In response to an AJAX request of a Bootstrap front end, the server extracts a target concurrency filtered by a preset filter from the Redis cache, and displays the target concurrency by using an ECharts instrument panel component through the Bootstrap front end interface.
7. The method of claim 1, wherein, The data access object layer determines a target database in at least two databases through the database query instruction, and performs a query operation in the target database according to the database query instruction to obtain a query result, and the operation comprises: The data access object layer parses the database query instruction to determine a to-be-queried data type and a query condition, wherein the to-be-queried data type comprises a structured data type and an unstructured data type, and the query condition comprises a time range, a query physical address and an identifier; In the case that the data type to be queried is the structured data type, the data access object layer determines that the target database is a relational database, and determines a target database instance in the relational database according to the query condition; The data access object layer executes a query operation in the database instance in the relational database to obtain a query result; In the case that the data type to be queried is the unstructured data type, the data access object layer determines that the target database is a non-relational database, and determines a target database instance in the non-relational database according to the query condition; The data access object layer executes a query operation in the database instance in the non-relational database to obtain a query result.
8. The method of claim 1, wherein, The data access object layer packs the query result to obtain a data encapsulation package, including: The DAO method of the data access object layer creates a target data transmission object according to the query result to encapsulate the query result, and obtains a data encapsulation package.
9. An integrated management platform applied to the data transmission method for the integrated management platform according to any one of claims 1-8, characterized in that, Including: The control layer is configured to parse a user request, determine a business logic to be executed, and call a corresponding business layer method to process the business logic through the business layer method, and determine a data operation flow of the data access object layer through the business layer. The business layer is configured to call a corresponding DAO method according to the data operation flow, and the DAO method includes a database query instruction. The data access object layer is configured to determine a target database in at least two databases through the database query instruction, execute a query operation in the target database according to the database query instruction, obtain a query result, pack the query result to obtain a data encapsulation package, and return the data encapsulation package to the Bootstrap front-end interface through the business layer and the control layer for display. The data access object layer is connected with at least two databases, and includes at least one DAO implementation class, and each DAO implementation class includes at least two DAO methods.
Citation Information
Patent Citations
Web background development framework
CN115729540A
Database operation method and device, computer equipment and storage medium
CN117112538A