Data persistence method and device, equipment, medium and program product

Through the metadata-driven data persistence method, the model information corresponding to business requirements is defined and stored in the metadata warehouse, solving the problem that traditional data persistence solutions cannot flexibly adapt to changes in business requirements, and achieving efficient, flexible and customized data persistence.

CN119513116APending Publication Date: 2025-02-25BEIJING BAIJU YIXING TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411524512.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

Traditional data persistence solutions cannot flexibly adapt to changes in business needs, resulting in frequent modification and reconstruction of data models, which are inefficient and poor flexibility.

Method used

The metadata-driven data persistence method is used to define the model information corresponding to business requirements, including entity persistence models, verification rules and isolation rules, and store the model verification device and model information in the target database and cache with corresponding relationships to achieve flexible persistence of data.

Benefits of technology

It realizes the customization of business needs, ensures the consistency and integrity of data, improves the efficiency of data retrieval and verification, supports a multi-tenant environment, and is easy to maintain and expand.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119513116A_ABST
    Figure CN119513116A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and discloses a data persistence method and device, equipment, a medium and a program product, and the method comprises the steps: defining model information corresponding to a single business demand for each business demand; determining a model calibrator corresponding to the single service demand according to the model information corresponding to the single service demand; storing the model verifier and the model information corresponding to each business demand in a target database and a cache according to a corresponding relationship; obtaining a target model calibrator from the cache according to the to-be-persisted data; verifying the to-be-persisted data through the target model verifier; and when the verification is passed, storing the to-be-persisted data in the target database according to the target model information in the metadata warehouse. According to the method, the corresponding model information is defined for each business requirement, different business scenes can be flexibly adapted, the model verifier and the model information are stored in the cache, and the data retrieval and verification speed and the data persistence efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a data persistence method, device, equipment, medium and program product. Background Art

[0002] In the current enterprise environment, with the continuous development and increasing complexity of business, traditional data persistence solutions are usually based on fixed data models and table structures, which cannot cope with the rapid iteration and change of business needs. When business needs change, frequent data model modification and reconstruction are often required, which is inefficient and inflexible.

[0003] Therefore, there is an urgent need for a data persistence solution with higher flexibility and efficiency. Summary of the invention

[0004] In view of this, the present invention provides a data persistence method, device, equipment, medium and program product to solve the problem that the related technology cannot flexibly adapt to changes in business needs and has low data persistence efficiency.

[0005] In a first aspect, the present invention provides a data persistence method, which is applied to a metadata-driven scenario. The data persistence method comprises:

[0006] Determine at least one business requirement, and for each business requirement, define model information corresponding to a single business requirement, wherein the model information includes: an entity persistence model, a verification rule, and an isolation rule; and store the model information corresponding to each business requirement in a metadata warehouse;

[0007] Determine a model checker corresponding to a single business requirement according to the model information corresponding to the single business requirement;

[0008] The model checker and model information corresponding to each of the business requirements are stored in the target database and cache in a corresponding relationship;

[0009] Acquire the data to be persisted, and acquire a target model checker from the cache according to the data to be persisted; the target model checker is the model checker corresponding to the data to be persisted;

[0010] Verifying the data to be persisted by the target model verifier;

[0011] When the data to be persisted passes verification, the data to be persisted is stored in a target database according to target model information in the metadata warehouse; the target model information is model information corresponding to the target model verifier.

[0012] In an optional implementation, the entity persistence model is used to define the storage method of the data to be persisted in the target database, the verification rules are used to verify the validity and consistency of the data to be persisted, and the isolation rules are used to control the data isolation and access rights of the data to be persisted for different business needs.

[0013] In an optional implementation, after storing the data to be persisted in the target database, the data persistence method further includes:

[0014] The persisted data is displayed through a visual interface.

[0015] In an optional implementation, the data persistence method further includes: setting a data add, delete, modify and query interface on the visualization interface; the data add, delete, modify and query interface is used for tenants to perform add, delete, modify and query operations.

[0016] In an optional implementation, the data persistence method further includes: when the data to be persisted fails verification, correcting the data to be persisted, and re-verifying the corrected data to be persisted.

[0017] In a second aspect, the present invention provides a data persistence device, which is applied to a metadata driven scenario, and the data persistence device comprises:

[0018] A data persistence module is used to determine at least one business requirement, and for each business requirement, define model information corresponding to a single business requirement, wherein the model information includes: entity persistence model, verification rules, and isolation rules; the model information corresponding to each business requirement is stored in a metadata warehouse; a model verifier corresponding to a single business requirement is determined based on the model information corresponding to the single business requirement; and the model verifier and model information corresponding to each business requirement are stored in a target database and a cache in a corresponding relationship;

[0019] A data processing module, used for obtaining data to be persisted, obtaining a target model verifier from the cache according to the data to be persisted; the target model verifier is a model verifier corresponding to the data to be persisted; the data to be persisted is verified by the target model verifier; when the data to be persisted passes the verification, the data to be persisted is stored in a target database according to the target model information in the metadata repository; the target model information is the model information corresponding to the target model verifier.

[0020] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the data persistence method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0021] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the data persistence method of the first aspect or any corresponding embodiment thereof.

[0022] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the data persistence method of the first aspect or any corresponding embodiment thereof.

[0023] The technical solution provided by the present invention has the following technical effects:

[0024] The technical solution of the present invention realizes the customization of business needs: by defining corresponding model information for each business need, it can flexibly adapt to different business scenarios and provide customized data processing and storage solutions. Ensure data consistency and integrity: verify the data through the model verifier to ensure that only data that meets business rules and format requirements can be persisted, thereby ensuring data consistency and integrity. Achieve efficient data retrieval and verification: store the model verifier and model information in the cache, which can speed up the speed of data retrieval and verification, improve response time and persistence efficiency. Improve the accuracy of data persistence: after the data verification is passed, the data is stored in the target database according to the target model information in the metadata warehouse, ensuring the accuracy of data persistence and compliance with business needs. Can support multiple tenants (users): The technical solution of the present invention can support the business needs of different tenants while ensuring the isolation and security of data. Easy to maintain and expand: because the corresponding relationship between model information and model verifier is clearly defined and stored, it is easy to maintain and expand new business needs or modify existing needs. The technical solution of the present invention realizes data verification and persistence through a model-driven method, improves the efficiency and accuracy of data processing, and also provides convenience for subsequent expansion and maintenance. It is conducive to processing large amounts of data and complex business logic. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0026] Figure 1 It is a flowchart of the data persistence method according to an embodiment of the present invention.

[0027] Figure 2 is a schematic diagram of the data structure of a target database according to an embodiment of the present invention;

[0028] Figure 3 It is a hierarchical schematic diagram of the overall solution of an embodiment of the present invention;

[0029] Figure 4 It is a flowchart of the overall solution of an embodiment of the present invention;

[0030] Figure 5 is a structural diagram of a data persistence device according to an embodiment of the present invention;

[0031] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

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

[0033] Traditional data persistence solutions usually have fixed data models and table structures, which makes it difficult to adapt to new data structures when rapid iteration and changes in business requirements are required. This results in frequent data model modifications and reconstructions, increasing development costs and risks. In addition, the method of adding extension tables is used to cope with changes in data models. With the introduction of multiple extension tables, the data model becomes more complex and maintainability decreases. Moreover, extension tables usually have specific business logic and data requirements, and have limited flexibility.

[0034] The embodiments of the present invention provide a data persistence method, device, equipment, medium and program product to solve the problem of inability to flexibly adapt to changes in business needs and low data persistence efficiency. The development cost caused by dynamic expansion and structural changes of the database is reduced, the development efficiency is improved and the maintenance difficulty is reduced.

[0035] An embodiment of the present invention provides an embodiment of a data persistence method. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0036] Figure 1 It is a flowchart of the data persistence method according to an embodiment of the present invention.

[0037] like Figure 1 As shown, a data persistence method is provided in an embodiment of the present invention, which is applied to metadata-driven scenarios and is a data persistence method based on metadata-driven. Metadata-driven: Metadata-driven is a development model, which mainly refers to abstracting the variable (extensible) part of the business into metadata, and managing and using it. This data persistence method can be applied to multi-tenant platforms, such as Software as a Service (SaaS) platforms. SaaS platform: It is an Internet-based software delivery model in which third-party providers provide applications to end tenants through a cloud platform.

[0038] The data persistence method includes:

[0039] S101: Determine at least one business requirement, and for each business requirement, define model information corresponding to the single business requirement.

[0040] In this embodiment, the model information includes: entity persistence model, verification rules and isolation rules. The model information corresponding to each business requirement is stored in the metadata warehouse.

[0041] In this embodiment, the entity persistence model is used to define the storage method of the data to be persisted in the target database, that is, the mapping relationship between the data to be persisted and the tables and fields in the target database. The entity persistence model defines how the data to be persisted is mapped to the tables and fields in the target database, including the structure of the mapping table, field type, data type, and relationship model (one-to-one, one-to-many, many-to-many, etc.). The entity persistence model ensures that the data to be persisted is stored in a way that suits business needs and query efficiency.

[0042] In this embodiment, the verification rules are used to verify the validity and consistency of the data to be persisted, and may verify whether the data to be persisted is within the validity period, whether it complies with preset rules, etc. The preset rules may include data types, field types (for example, the amount is accurate to the last two digits of the decimal, the order number is 3 digits), data formats (for example, date format, email format, mobile phone number format), etc. The verification rules help prevent invalid or incomplete data from being stored, thereby maintaining the quality and integrity of the data.

[0043] In this embodiment, the isolation rules are used to control the data isolation and access rights of the data to be persisted for different business needs. The isolation rules are part of the database transaction management, which is used to control the access of concurrent transactions to data to prevent data conflicts and inconsistencies. For example, the data to be persisted for different business needs is set with a unique identifier, which is used to distinguish the data to be persisted for different business needs. The unique identifier can be a tenant ID, order number, etc. Different access rights are set for the data to be persisted for different business needs. When the tenant types include ordinary tenants and administrators, the access rights of ordinary tenants can be set to be smaller than those of administrators, and certain data can be set to be accessible only to administrators and not ordinary tenants. In addition, different isolation levels are set for the data to be persisted for different business needs. The isolation level defines which changes of other transactions a transaction may see in a concurrent environment. Common isolation levels include: read uncommitted, read committed, repeatable read, and serialization.

[0044] In this embodiment, the isolation rules are also used to avoid data conflicts and corruption in a concurrent environment. For example, when the model checker and model information corresponding to each business requirement are synchronously stored in the cache in a corresponding relationship, it may be necessary to deal with concurrent access and data consistency issues. The isolation rules ensure that no conflicts or data corruption occur when data is read and written.

[0045] In this embodiment, the data persistence method is applied to a multi-tenant platform, and each tenant has at least one business requirement.

[0046] In this embodiment, the tenant can input the corresponding model information through a graphical interface or a command line interface. This interface can be a web form, a mobile application, or a desktop application. As an example, the model name, model type, model rule, etc. of the corresponding entity persistence model can be input through the graphical interface.

[0047] S102: Determine a model checker corresponding to a single business requirement according to model information corresponding to the single business requirement.

[0048] As an example, the model checker corresponding to a single business requirement can be automatically generated by a program according to the model information corresponding to the single business requirement. When the model information corresponding to a business requirement is obtained, the model checker corresponding to each business requirement is determined by the program based on the model information corresponding to each business requirement.

[0049] The model checker is mainly used to check the following aspects of the data to be persisted:

[0050] Data format: Make sure the data to be persisted conforms to the expected format, such as date, time, phone number, email address, etc.

[0051] Data type: Check whether the data to be persisted is of the correct data type, such as integer, floating point number, string, Boolean value, etc.

[0052] Field Completeness: Verify that all required fields are provided and not missing.

[0053] Field length: Checks whether the length of a string field is within the allowed range, such as the length limit of the tenant name.

[0054] Numeric range: Ensure that the data of the numeric type is within a reasonable range. For example, age cannot be a negative number.

[0055] Logical constraints: verify the logical relationship between data, such as whether the value of one field depends on the value of another field.

[0056] Uniqueness: Ensure that the value of certain fields, such as tenant ID or email address, is unique in the database.

[0057] Business rules: Based on business requirements, verify whether the data to be persisted meets specific business rules, such as the order date cannot be in the future.

[0058] Related data verification: Check the association between the data to be persisted and other data, such as foreign key constraints, to ensure data consistency.

[0059] The model checker performs these checks before the data to be persisted is stored in the target database to ensure the accuracy, integrity and security of the data. The model checker can be a custom code logic, a ready-made check library or framework, or a database-level constraint. Through the verification of the model checker, data quality can be improved, data errors can be reduced, and the database can be protected from bad data.

[0060] Usually, verification includes independent front-end form verification and back-end form verification, which easily leads to inconsistency and high development cost. As an example, in order to reduce the development difficulty and enable developers to focus more on business logic, in this embodiment, the model verifier corresponding to a single business requirement can be directly determined according to the verification rules in the model information corresponding to the single business requirement.

[0061] S103: The model checker and model information corresponding to each business requirement are stored in the target database and cache in a corresponding relationship.

[0062] In this embodiment, the model checker and model information corresponding to each business requirement are stored in the target database in a corresponding relationship, and the model checker and model information corresponding to each business requirement are stored in the cache in a corresponding relationship. The target database is any type of database, such as a relational database (e.g., Mysql), a heterogeneous database, etc. As an example, the target database includes Figure 2 Information shown. This embodiment supports multiple database types. Regardless of whether the target database is a relational database or other types of databases, this embodiment can provide a consistent data processing and verification mechanism. Usually the cache is ES and Redis. Specifically, the model verifier and model information can be stored in the form of key-value pairs. As an example, the key can be a unique identifier of the model verifier, and the value is an instance of the model verifier or its serialized form. Specifically, the model verifier and model information corresponding to each business requirement can be stored in the target database and cache in a corresponding relationship through the Object Storage Service (OSS).

[0063] In this embodiment, by matching the model checker and model information with business requirements, it can flexibly adapt to different business scenarios and can be easily expanded to support new business requirements. The model checker and model information are centrally stored, which is convenient for management and maintenance, and also convenient for data backup and recovery. By synchronously storing the model checker and model information in the cache, data consistency can be ensured, and data accuracy can be maintained even in high concurrency.

[0064] In the present invention, the technical solutions of S101-S103 can be used as the preliminary preparation stage to store as many model verifiers and model information as possible in the target database and cache, so that the model verifier corresponding to the data to be persisted can be found in the cache in the actual persistent application stage later.

[0065] In the present invention, the target database and cache can be updated in real time. As an example, the data to be persisted is obtained. When the target model verifier cannot be obtained from the cache according to the data to be persisted, that is, when there is no model verifier corresponding to the data to be persisted in the cache, the model verifier corresponding to the data to be persisted is obtained from the target database first. When the model verifier corresponding to the data to be persisted is not found in the target database, the model information corresponding to the data to be persisted is defined according to the technical solutions of S101-S103 above. The model information includes: entity persistence model, verification rules and isolation rules. The model information corresponding to the data to be persisted is stored in the metadata warehouse. The model verifier corresponding to the data to be persisted is determined according to the model information corresponding to the data to be persisted. The model verifier and model information corresponding to the data to be persisted are stored in the target database and cache in a corresponding relationship, and then the partial technical solutions in S104 (obtaining the target model verifier from the cache according to the data to be persisted) and the technical solutions of S105-S106 are executed.

[0066] In this embodiment, the technical solution of obtaining the model verifier from the cache first and then obtaining it from the target database if the cache misses can improve the speed of determining the model verifier. The cache is usually faster than the database because the cache is stored in the memory, reducing disk I / O operations. By checking the cache first, the number of accesses to the database can be reduced, thereby improving the speed of determining the model verifier. The database load can be reduced: By storing frequently accessed model verifiers in the cache, the database load can be reduced. In a high-concurrency environment, the database can be prevented from becoming a performance bottleneck. It can respond quickly: For read operations, if the model verifier is in the cache, the result can be returned immediately, providing a faster response time and improving the tenant experience. Reducing access to the database can reduce the hardware and maintenance costs of the database, especially when using cloud database services, which can significantly reduce costs. The technical solution of obtaining the model verifier from the cache first and then obtaining it from the target database if the cache misses can significantly improve and reliability while reducing costs and complexity.

[0067] S104: Acquire the data to be persisted, and acquire the target model verifier from the cache according to the data to be persisted.

[0068] In this embodiment, the target model checker is the model checker corresponding to the data to be persisted.

[0069] In this embodiment, the target model checker is obtained from the cache according to the data to be persisted. The use of the cache can significantly improve the speed of data retrieval and reduce direct access to the target database, thereby improving the persistence efficiency. Data is first obtained from the cache, and if the cache does not hit, it is obtained from the database, which can reduce the delay of data retrieval and improve efficiency.

[0070] This embodiment can be integrated with existing databases and cache systems without making large-scale changes to the existing architecture. The model checker can be used to check data before it is persisted to prevent non-compliant data from entering the database, thereby improving data security. The model checker can be customized according to complex business logic to ensure that data complies with all business rules before entering the database.

[0071] In this embodiment, the data to be persisted includes a (unique) identifier, such as a first identifier, and the model verifier stored in the cache also includes a corresponding identifier. Based on the first identifier of the data to be persisted, it can be searched in the cache whether there is an identical identifier. When an identifier identical to the first identifier is retrieved in the cache, the model verifier corresponding to the identifier identical to the first identifier in the cache is determined as the target model verifier.

[0072] S105: Verify the data to be persisted by the target model verifier.

[0073] In this embodiment, the verification rules corresponding to the target model verifier can be used to verify the persistent data. After executing the technical solution of S105, the verification result is returned and displayed on the visual interface. The tenant can directly see the verification result to facilitate subsequent operations. The verification result includes: prompt information of verification passing and verification failing, and when the verification fails, the reason for failure is prompted to facilitate the tenant to modify.

[0074] S106: When the data to be persisted passes verification, the data to be persisted is stored in the target database according to the target model information in the metadata warehouse.

[0075] In this embodiment, the target model information is model information corresponding to the target model verifier.

[0076] In this embodiment, when the data to be persisted fails to pass the verification, the data to be persisted is corrected, and the corrected data to be persisted is re-verified.

[0077] In this embodiment, after the data to be persisted is stored in the target database, the data persistence method further includes: displaying the persisted data through a visual interface. Setting a data add, delete, modify and query interface in the visual interface. The data add, delete, modify and query interface is used for tenants to perform add, delete, modify and query operations.

[0078] In this embodiment, a visualization interface is provided to allow tenants to access the persisted data. Visual display of data is achieved, including but not limited to tables, charts, graphs, etc., so that tenants can understand and analyze data. By setting up the add, delete, modify and query data interface in the visualization interface, the add, delete, query and modify functions are provided to tenants, allowing tenants to operate on the data, and these operations need to be verified by the model verifier to ensure the consistency and integrity of the data. The operation results should be fed back to the tenant in real time, including prompts of success or failure, and the specific reasons for the failure.

[0079] In this embodiment, data security and isolation are achieved through isolation rules. Ensure that tenants can only access and operate authorized data. Implement data isolation in a multi-tenant environment to ensure that data between different tenants do not interfere with each other. In this embodiment, all data operations of tenants are audited and operation logs are recorded, including operation time, operation type, operation content and operation results. Provide a log query function to allow administrators and tenants to view and analyze operation history. Optimize the performance of data retrieval and display to ensure that good response speed can be maintained even with large amounts of data. Implement a caching mechanism to reduce direct access to the database and increase data access speed. Take scalability into consideration so that new business requirements and model information can be easily added later.

[0080] like Figure 3 As shown, the overall solution of the present invention includes three layers: the user end (PC, app, web, etc.), the data logic control layer (defining entity persistence model, verification rules, isolation rules, and providing a visual interface) and the data persistence layer (relational database, heterogeneous database, cache). As an example, the overall process of the technical solution of the present invention is as follows: Figure 4 shown.

[0081] The scalable entity persistence solution of the present invention significantly improves development efficiency and flexibility of database models by providing flexible data access mechanisms, supporting multiple databases, and realizing decoupling of data models from business logic. Compared with related technologies, the present invention allows developers to customize data persistence behaviors according to needs, including data mapping, query and transaction management, and adapt to complex business scenarios (for example: business tables with large amounts of data need to add fields, and the invention is used as a mapping table structure to increase flexibility, so that it will not be restricted by the cleaning costs and risks of the database (DB, Database)), and has a high degree of flexibility. The key technical point of the present invention is to achieve efficient creation and strict verification of the model, while ensuring the safe isolation of data in multiple environments.

[0082] In addition, in order to simplify development, a unified data access interface and abstraction layer can be used to simplify data access operations, reduce repeated coding, and enable developers to focus more on business logic (for example, the front-end form verification and the back-end form verification are usually independent of each other, which can easily cause inconsistencies. The use of the technical solution of the present invention for high-speed caching can achieve unified management and simplify development).

[0083] It should be noted that the contents not described in detail in the specification of the present invention belong to the common knowledge of those skilled in the art.

[0084] In this embodiment, a data persistence device is also provided, and a single device is used to implement the above-mentioned embodiments and optional implementation methods, which have been described and will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0085] Figure 5 It is a structural diagram of a data persistence device according to an embodiment of the present invention.

[0086] The present invention provides a data persistence device, such as Figure 5 As shown, the data persistence device is applied to a metadata-driven scenario, and the data persistence device includes:

[0087] The data persistence module 11 is used to determine at least one business requirement, and for each business requirement, define the model information corresponding to the single business requirement, the model information includes: entity persistence model, verification rules and isolation rules. The model information corresponding to each business requirement is stored in the metadata warehouse. The model verifier corresponding to the single business requirement is determined according to the model information corresponding to the single business requirement. The model verifier and model information corresponding to each business requirement are stored in the target database and cache in a corresponding relationship.

[0088] The data processing module 12 is used to obtain the data to be persisted, and obtain the target model verifier from the cache according to the data to be persisted. The target model verifier is the model verifier corresponding to the data to be persisted. The data to be persisted is verified by the target model verifier. When the data to be persisted passes the verification, the data to be persisted is stored in the target database according to the target model information in the metadata warehouse. The target model information is the model information corresponding to the target model verifier.

[0089] In an optional implementation, the entity persistence model is used to define the storage method of the data to be persisted in the target database, the verification rules are used to verify the validity and consistency of the data to be persisted, and the isolation rules are used to control the data isolation and access rights of the data to be persisted for different business needs.

[0090] In an optional implementation, the data persistence device further includes: a visualization module 13. The visualization module 13 is used to display the persisted data through a visualization interface after the data to be persisted is stored in the target database.

[0091] In an optional implementation, the visualization module 13 is further used to set a data add, delete, modify and query interface in the visualization interface. The data add, delete, modify and query interface is used for tenants to perform add, delete, modify and query operations.

[0092] In an optional implementation, the data processing module 12 is further configured to correct the data to be persisted when the data to be persisted fails verification, and re-verify the corrected data to be persisted.

[0093] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0094] The data persistence device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0095] The embodiment of the present invention also provides a computer device having the above Figure 5 The data persistence device shown.

[0096] See also Figure 6 , Figure 6 Schematic diagram of the hardware structure of the computer device according to the embodiment of the present invention. Figure 6 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In an optional embodiment, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor device). Figure 6 A processor 10 is taken as an example.

[0097] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0098] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0099] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating device, an application required for at least one function. The data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage devices. In an optional embodiment, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0100] The memory 20 may include a volatile memory, such as a random access memory. The memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive. The memory 20 may also include a combination of the above-mentioned types of memory.

[0101] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0102] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc. Further, the storage medium can also include a combination of the above-mentioned types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0103] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0104] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A data persistence method, characterized in that: Applied to metadata-driven scenarios, the method includes: Determine at least one business requirement, and for each business requirement, define model information corresponding to a single business requirement, wherein the model information includes: an entity persistence model, a verification rule, and an isolation rule; and store the model information corresponding to each business requirement in a metadata warehouse; Determine a model checker corresponding to a single business requirement according to the model information corresponding to the single business requirement; The model checker and model information corresponding to each of the business requirements are stored in the target database and cache in a corresponding relationship; Acquire the data to be persisted, and acquire a target model checker from the cache according to the data to be persisted; the target model checker is the model checker corresponding to the data to be persisted; Verifying the data to be persisted by the target model verifier; When the data to be persisted passes verification, the data to be persisted is stored in a target database according to target model information in the metadata warehouse; the target model information is model information corresponding to the target model verifier.

2. The method according to claim 1, characterized in that The entity persistence model is used to define the storage method of the data to be persisted in the target database, the verification rules are used to verify the validity and consistency of the data to be persisted, and the isolation rules are used to control the data isolation and access rights of the data to be persisted according to different business needs.

3. The method according to claim 1, characterized in that After storing the data to be persisted in the target database, the method further includes: The persisted data is displayed through a visual interface.

4. The method according to claim 3, characterized in that The method further includes: setting a data interface for adding, deleting, modifying and checking data on the visualization interface; the data interface for adding, deleting, modifying and checking data is used for tenants to perform addition, deletion, modification and query operations.

5. The method according to claim 1, characterized in that The method further includes: when the data to be persisted fails verification, correcting the data to be persisted, and re-verifying the corrected data to be persisted.

6. A data persistence device, characterized in that: Applied to metadata-driven scenarios, the device includes: A data persistence module is used to determine at least one business requirement, and for each business requirement, define model information corresponding to a single business requirement, wherein the model information includes: entity persistence model, verification rules, and isolation rules; the model information corresponding to each business requirement is stored in a metadata warehouse; a model verifier corresponding to a single business requirement is determined based on the model information corresponding to the single business requirement; and the model verifier and model information corresponding to each business requirement are stored in a target database and a cache in a corresponding relationship; A data processing module, used for obtaining data to be persisted, obtaining a target model verifier from the cache according to the data to be persisted; the target model verifier is a model verifier corresponding to the data to be persisted; the data to be persisted is verified by the target model verifier; when the data to be persisted passes the verification, the data to be persisted is stored in a target database according to the target model information in the metadata repository; the target model information is the model information corresponding to the target model verifier.

7. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the data persistence method according to any one of claims 1 to 5 by executing the computer instructions.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the data persistence method according to any one of claims 1 to 5.

9. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to enable a computer to execute the data persistence method according to any one of claims 1 to 5.

Citation Information

Cited By

  • Intelligent bidding method and system based on behavior pattern recognition

    CN120725770A