Model migration method, device, medium and equipment under different object relational mapping
By dynamically obtaining the features of the LINQ to SQL data model and using the preset configuration interface of Entity Framework 6 for adaptive configuration, the compatibility problem of migrating the LINQ to SQL data model to Entity Framework 6 is solved, and data across technology platforms is realized Model interoperability.
Patent Information
- Application Number
- CN202311660805.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-04
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2043-12-04
AI Technical Summary
It is not feasible to directly use the data model defined in LINQ to SQL for Entity Framework 6, because the two use different mechanisms and rules in dealing with data model and database mapping.
Dynamically obtain the model characteristics of the data model defined in LINQ to SQL through a type reflector, and adaptively configure the model characteristics through the preset configuration interface provided in Entity Framework 6 to establish the data model and the data table in Entity Framework 6. The mapping method between using code configuration.
Entity Framework 6 is implemented to identify the relationship between the data model and the database in LINQ to SQL, so that the same data model can be used in both new and old technologies at the same time.
Smart Images

Figure CN117742780B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a model migration method, device, medium and equipment under different object relationship mappings. Background Art
[0002] LINQ to SQL is a data access technology that allows us to query and manipulate data in a SQL Server database using syntax similar to SQL. It uses a technology called Object Relational Mapping (ORM) to map tables, columns, and relationships in the database to classes, properties, and methods in .NET, allowing us to manipulate data in an object-oriented way.
[0003] Entity Framework 6 is also a data access technology, and it also uses ORM technology, but LINQ to SQL and Entity Framework 6 use different mechanisms and rules in dealing with data models and database mapping. Therefore, it is not feasible to directly use the data model defined in LINQ to SQL for Entity Framework 6. Summary of the invention
[0004] Based on this, it is necessary to provide model migration methods, devices, media and equipment under different object-relational mappings to solve the problem that it is not feasible to directly use the data model defined in LINQ to SQL for Entity Framework 6.
[0005] A model migration method under different object relational mappings, the method comprising:
[0006] Dynamically obtain the model characteristics of the data model defined in LINQ to SQL through the type reflector;
[0007] The model features are adaptively configured through a preset configuration interface provided in Entity Framework 6, so that a mapping method configured using code is established between the configured data model and the data table in Entity Framework 6.
[0008] In one embodiment, dynamically obtaining the model characteristics of the data model defined in LINQ to SQL through the type reflector includes:
[0009] Import the System.Reflection namespace;
[0010] In the System.Reflection namespace, obtain the type of the data model defined in LINQ to SQL as feature information;
[0011] Get the TableAttribute attribute defined on the type as feature information; the TableAttribute attribute indicates the correspondence between the class and the table;
[0012] Get all attributes or fields defined on the type as feature information;
[0013] Obtain the ColumnAttribute attribute or AssociationAttribute attribute defined on the attribute or field as characteristic information; wherein the ColumnAttribute attribute or AssociationAttribute attribute indicates the correspondence between the attribute or field on the type and the column or relationship of the table;
[0014] All acquired feature information is combined into the model feature by concatenating character strings.
[0015] In one embodiment, the adaptively configuring the model features through a preset configuration interface provided in Entity Framework 6 includes:
[0016] Import the System.Data.Entity namespace;
[0017] Create a class that inherits from DbContext;
[0018] Rewrite the OnModelCreating method in the DbContext class and use the preset configuration interface in the DbContext class to configure the mapping relationship between the data model and the database connected to Entity Framework 6;
[0019] According to the model characteristics of the data model defined in LINQ to SQL, use all methods provided in the preset configuration interface to specify the correspondence between classes and tables, properties and columns, associations and relationships;
[0020] Define a DbSet for each data model in the DbContext class <t>Property; where DbSet <t>The attributes indicate the database table to which the data model corresponds and the data operation functions provided.
[0021] In one embodiment, the method further comprises:
[0022] If you use Code First development for adaptive configuration, use the Add-Migration command to create a new migration and use the Update-Database command to apply the new migration to the database to which Entity Framework 6 is connected.
[0023] A model migration device under different object relationship mappings, the model migration device under different object relationship mappings comprising:
[0024] The feature acquisition module is used to dynamically obtain the model features of the data model defined in LINQ to SQL through the type reflector;
[0025] The migration module is used to adaptively configure the model features through a preset configuration interface provided in Entity Framework 6, so that a mapping method configured using code is established between the configured data model and the data table in Entity Framework 6.
[0026] In one embodiment, the feature acquisition module is specifically used to:
[0027] Import the System.Reflection namespace;
[0028] In the System.Reflection namespace, obtain the type of the data model defined in LINQ to SQL as feature information;
[0029] Get the TableAttribute attribute defined on the type as feature information; the TableAttribute attribute indicates the correspondence between the class and the table;
[0030] Get all attributes or fields defined on the type as feature information;
[0031] Obtain the ColumnAttribute attribute or AssociationAttribute attribute defined on the attribute or field as characteristic information; wherein the ColumnAttribute attribute or AssociationAttribute attribute indicates the correspondence between the attribute or field on the type and the column or relationship of the table;
[0032] All acquired feature information is combined into the model feature by concatenating character strings.
[0033] In one embodiment, the migration module is specifically used to:
[0034] Import the System.Data.Entity namespace;
[0035] Create a class that inherits from DbContext;
[0036] Rewrite the OnModelCreating method in the DbContext class and use the preset configuration interface in the DbContext class to configure the mapping relationship between the data model and the database connected to Entity Framework 6;
[0037] According to the model characteristics of the data model defined in LINQ to SQL, use all methods provided in the preset configuration interface to specify the correspondence between classes and tables, properties and columns, associations and relationships;
[0038] Define a DbSet for each data model in the DbContext class <t>Property; where DbSet <t>The attributes indicate the database table to which the data model corresponds and the data operation functions provided.
[0039] In one embodiment, the model migration device under different object relationship mapping is further used for:
[0040] If you use Code First development for adaptive configuration, use the Add-Migration command to create a new migration and use the Update-Database command to apply the new migration to the database connected to Entity Framework 6.
[0041] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the processor executes the steps of the model migration method under different object relationship mappings.
[0042] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the model migration method under different object relational mappings.
[0043] The present invention provides a model migration method, apparatus, medium and device under different object-relational mappings, first dynamically obtains the model features of the data model defined in LINQ to SQL through a type reflector, and then adaptively configures the model features through a preset configuration interface provided in Entity Framework 6, so that a mapping method using code configuration is established between the configured data model and the data table in Entity Framework 6. In this way, Entity Framework 6 can identify the relationship between the data model in LINQ to SQL and the database, so that the same data model can be used in both new and old technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only 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.
[0045] in:
[0046] Figure 1 It is a flowchart of the model migration method under different object-relational mapping;
[0047] Figure 2 It is a schematic diagram of the structure of the model migration device under different object relational mapping;
[0048] Figure 3 This is a structural block diagram of a computer device. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. Exemplary processes, methods, systems, products, or devices that include a series of steps or units are not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.
[0051] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0052] like Figure 1 As shown, Figure 1 The flowchart of the model migration method under different object relationship mappings in one embodiment is shown in FIG. The steps provided by the model migration method under different object relationship mappings in this embodiment include:
[0053] S101, dynamically obtaining model features of a data model defined in LINQ to SQL through a type reflector.
[0054] Model features refer to some specific properties, configurations or meta-information of a data model, which describe some important aspects of the model, such as the model's structure, associations, mappings between attributes and fields, etc. Model features can help understand the specific mapping rules between a data model and a database in LINQ to SQL.
[0055] In a specific embodiment, the specific steps of obtaining the model characteristics of the data model defined in LINQ to SQL include:
[0056] (1) Import the System.Reflection namespace.
[0057] Among other things, this namespace contains classes and methods that allow us to get the properties and values defined on model types (classes) and members (attributes) at runtime.
[0058] (2) In the System.Reflection namespace, obtain the type of the data model defined in LINQ to SQL as feature information.
[0059] Specifically, we can use the typeof operator or the Type.GetType method to get the type. For example:
[0060] / / Get Customer type
[0061] Type customerType=typeof(Customer);
[0062] / / or
[0063] Type customerType=Type.GetType("Customer");
[0064] (3) Obtain the TableAttribute attribute defined on the type as feature information; wherein the TableAttribute attribute indicates the correspondence between the class and the table.
[0065] Exemplary:
[0066]
[0067] This code indicates that the Customer class corresponds to the table named Customers in the database. Further, we can use the GetCustomAttribute method to obtain the TableAttribute attribute defined on the type, for example:
[0068] / / Get the TableAttribute property defined on the Customer type
[0069] TableAttribute tableAttribute=customerType.GetCustomAttribute <tableattribute>();
[0070] (4) Obtain all attributes or fields defined on the type as feature information.
[0071] Specifically, these attributes or fields represent members in a class, which may correspond to columns or relations in a database, for example:
[0072] [Column(IsPrimaryKey=true,IsDbGenerated=true)]
[0073] public int Id {get; set;}
[0074] [Column(Name="CustomerName")]
[0075] public string Name{get;set;}
[0076] [Association(ThisKey="CategoryId",OtherKey="CategoryId")]
[0077] public Category Category{get;set;}
[0078] This code indicates that the Id property corresponds to the Id column in the database and is the primary key and auto-increment column; the Name property corresponds to the CustomerName column in the database; the Category property is a navigation property, which indicates a one-to-one or one-to-many relationship between the current class and the Category class, which are connected through the CategoryId column. We can use the GetProperties or GetFields method to obtain all the properties or fields defined on the type, for example:
[0079] [Column(IsPrimaryKey=true,IsDbGenerated=true)]
[0080] public int Id {get; set;}
[0081] [Association(ThisKey="CategoryId",OtherKey="CategoryId")]
[0082] public Category Category{get;set;}
[0083] (5) Obtain the ColumnAttribute attribute or AssociationAttribute attribute defined on the attribute or field as feature information.
[0084] The ColumnAttribute attribute or the AssociationAttribute attribute indicates the correspondence between the attribute or field on the type and the column or relationship of the table.
[0085] Exemplary:
[0086] [Column(IsPrimaryKey=true,IsDbGenerated=true)]
[0087] public int Id {get; set;}
[0088] [Association(ThisKey="CategoryId",OtherKey="CategoryId")]
[0089] public Category Category{get;set;}
[0090] This code indicates that the ColumnAttribute attribute is defined on the Id attribute, which specifies the correspondence between the Id attribute and the Id column; the AssociationAttribute attribute is defined on the Category attribute, which specifies the association between the Category attribute and the Category class. We can use the GetCustomAttribute method to obtain the ColumnAttribute or AssociationAttribute attributes defined on a property or field, for example:
[0091] / / Get the ColumnAttribute property defined on the Id attribute
[0092] ColumnAttribute columnAttribute=idProperty.GetCustomAttribute <columnattribute>();
[0093] / / Get the AssociationAttribute property defined on the Category attribute
[0094] AssociationAttribute associationAttribute=categoryProperty.GetCustomAttribute <associationattribute>();
[0095] (6) All acquired feature information is combined into model features by concatenating character strings.
[0096] S102, adaptively configuring the model features through the preset configuration interface provided in Entity Framework 6, so that a mapping method configured using code is established between the configured data model and the data table in Entity Framework 6.
[0097] The purpose of this step is to convert the mapping information in LINQ to SQL into the mapping information in Entity Framework 6. This information is usually specified in code. This allows Entity Framework 6 to recognize the relationship between the data model in LINQ to SQL and the database, so that the same data model can be used in both new and old technologies.
[0098] (1) Import the System.Data.Entity namespace.
[0099] Specifically, this namespace contains some classes and methods that allow us to access and operate the database using Entity Framework6.
[0100] (2) Create a class that inherits from DbContext.
[0101] This class will be responsible for managing the mapping relationship between the model and the database, as well as handling database operations. Example:
[0102]
[0103] (3) Override the OnModelCreating method in the DbContext class and use the preset configuration interface in the DbContext class to configure the mapping relationship between the data model and the database connected to Entity Framework 6.
[0104] This method is called when the DbContext is first used, and it lets Entity Framework 6 know how to map the model to the database. Example:
[0105]
[0106]
[0107] (4) Based on the model features of the data model defined in LINQ to SQL, use all methods provided in the preset configuration interface to specify the correspondence between classes and tables, attributes and columns, associations and relationships.
[0108] Exemplary:
[0109]
[0110] (5) Define a DbSet for each data model in the DbContext class <t>property.
[0111] Where DbSet <t>The attributes indicate the database table to which the data model corresponds and the data operation functions provided.
[0112] Exemplary:
[0113]
[0114] In this way, we have completed the adaptive configuration of the model features of the data model defined in LINQ toSQL through the Fluent API provided in Entity Framework 6, so that a mapping method configured using code is established between the configured data model and the data table in Entity Framework 6.
[0115] In a specific embodiment, in order to apply subsequent changes to the data model (such as adding new properties or modifying properties) to the database, if the Code First development method is used for adaptive configuration, the Add-Migration command is used to create a new migration that includes the model changes. Finally, the Update-Database command is used to apply the new migration to the database connected to Entity Framework 6 so that the database structure is consistent with the model.
[0116] The model migration methods under the above different object-relational mappings first dynamically obtain the model features of the data model defined in LINQ toSQL through the type reflector, and then adaptively configure the model features through the preset configuration interface provided in Entity Framework 6, so that a mapping method using code configuration is established between the configured data model and the data table in Entity Framework 6. In this way, Entity Framework 6 can identify the relationship between the data model in LINQ to SQL and the database, so that the same data model can be used in both new and old technologies.
[0117] In one embodiment, Figure 2 As shown, a model migration device under different object relational mappings is proposed, and the device includes:
[0118] A feature acquisition module 201 is used to dynamically acquire model features of a data model defined in LINQ to SQL through a type reflector;
[0119] The migration module 202 is used to adaptively configure the model features through the preset configuration interface provided in Entity Framework 6, so that a mapping method configured using code is established between the configured data model and the data table in Entity Framework 6.
[0120] In one embodiment, the feature acquisition module 201 is specifically used to:
[0121] Import the System.Reflection namespace;
[0122] In the System.Reflection namespace, obtain the type of the data model defined in LINQ to SQL as feature information;
[0123] Get the TableAttribute attribute defined on the type as feature information; the TableAttribute attribute indicates the correspondence between the class and the table;
[0124] Get all attributes or fields defined on the type as feature information;
[0125] Obtain the ColumnAttribute attribute or AssociationAttribute attribute defined on the attribute or field as characteristic information; wherein the ColumnAttribute attribute or AssociationAttribute attribute indicates the correspondence between the attribute or field on the type and the column or relationship of the table;
[0126] All acquired feature information is combined into model features by concatenating strings.
[0127] In one embodiment, the migration module 202 is specifically configured to:
[0128] Import the System.Data.Entity namespace;
[0129] Create a class that inherits from DbContext;
[0130] Rewrite the OnModelCreating method in the DbContext class and use the preset configuration interface in the DbContext class to configure the mapping relationship between the data model and the database connected to Entity Framework 6;
[0131] According to the model characteristics of the data model defined in LINQ to SQL, use all methods provided in the preset configuration interface to specify the correspondence between classes and tables, properties and columns, associations and relationships;
[0132] Define a DbSet for each data model in the DbContext class <t>Property; where DbSet <t>The attributes indicate the database table to which the data model corresponds and the data operation functions provided.
[0133] In one embodiment, the model migration device under different object relationship mapping is also used for:
[0134] If you use Code First development for adaptive configuration, use the Add-Migration command to create a new migration and use the Update-Database command to apply the new migration to the database to which Entity Framework 6 is connected.
[0135] Figure 3 FIG. 2 shows an internal structure diagram of a computer device in one embodiment. Figure 3 As shown, the computer device includes a processor, a memory and a network interface connected via a system bus. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor may implement a model migration method under different object relationship mappings. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor may implement a model migration method under different object relationship mappings. Those skilled in the art will appreciate that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0136] A computer-readable storage medium stores a computer program, which implements the following steps when executed by a processor: dynamically obtaining model features of a data model defined in LINQ to SQL through a type reflector; adaptively configuring the model features through a preset configuration interface provided in Entity Framework 6, so that a mapping method configured using code is established between the configured data model and a data table in Entity Framework 6.
[0137] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented: dynamically obtaining model features of a data model defined in LINQ to SQL through a type reflector; adaptively configuring the model features through a preset configuration interface provided in Entity Framework 6, so that a mapping method configured using code is established between the configured data model and a data table in Entity Framework 6.
[0138] It should be noted that the above-mentioned model migration methods, devices, equipment and computer-readable storage media under different object relationship mappings belong to a general inventive concept, and the contents of the model migration methods, devices, equipment and computer-readable storage media embodiments under different object relationship mappings can be mutually applicable.
[0139] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0140] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0141] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.< / t> < / t> < / t> < / t> < / associationattribute> < / columnattribute> < / tableattribute> < / t> < / t> < / t> < / t>
Claims
1. A model migration method under different object relational mappings, characterized in that: The method comprises: Dynamically obtain the model characteristics of the data model defined in LINQ to SQL through the type reflector; Adaptively configure the model features through a preset configuration interface provided in Entity Framework 6, so that a mapping method configured using code is established between the configured data model and the data table in Entity Framework 6; The adaptive configuration of the model features through the preset configuration interface provided in Entity Framework 6 includes: Import the System.Data.Entity namespace; Create a class that inherits from DbContext; Rewrite the OnModelCreating method in the DbContext class and use the preset configuration interface in the DbContext class to configure the mapping relationship between the data model and the database connected to Entity Framework 6; According to the model characteristics of the data model defined in LINQ to SQL, use all methods provided in the preset configuration interface to specify the correspondence between classes and tables, properties and columns, associations and relationships; Define a DbSet for each data model in the DbContext class <t>Property; where DbSet <t> The attributes indicate the database table to which the data model corresponds and the data operation functions provided.< / t> < / t> 2. The method according to claim 1, characterized in that The method of dynamically obtaining the model characteristics of the data model defined in LINQ toSQL through the type reflector includes: Import the System.Reflection namespace; In the System.Reflection namespace, obtain the type of the data model defined in LINQ to SQL as feature information; Get the TableAttribute attribute defined on the type as feature information; the TableAttribute attribute indicates the correspondence between the class and the table; Get all attributes or fields defined on the type as feature information; Obtain the ColumnAttribute attribute or AssociationAttribute attribute defined on the attribute or field as characteristic information; wherein the ColumnAttribute attribute or AssociationAttribute attribute indicates the correspondence between the attribute or field on the type and the column or relationship of the table; All acquired feature information is combined into the model feature by concatenating character strings.
3. The method according to claim 1, characterized in that: The method further comprises: If you use Code First development for adaptive configuration, use the Add-Migration command to create a new migration and use the Update-Database command to apply the new migration to the database to which Entity Framework 6 is connected.
4. A model migration device under different object relationship mappings, characterized in that: The model migration device under different object relationship mappings includes: The feature acquisition module is used to dynamically obtain the model features of the data model defined in LINQ to SQL through the type reflector; A migration module, used for adaptively configuring the model features through a preset configuration interface provided in Entity Framework 6, so that a mapping method configured using code is established between the configured data model and the data table in Entity Framework 6; The migration module is specifically used for: Import the System.Data.Entity namespace; Create a class that inherits from DbContext; Rewrite the OnModelCreating method in the DbContext class and use the preset configuration interface in the DbContext class to configure the mapping relationship between the data model and the database connected to Entity Framework 6; According to the model characteristics of the data model defined in LINQ to SQL, use all methods provided in the preset configuration interface to specify the correspondence between classes and tables, properties and columns, associations and relationships; Define a DbSet for each data model in the DbContext class <t>Property; where DbSet <t> The attributes indicate the database table to which the data model corresponds and the data operation functions provided.< / t> < / t> 5. The model migration device under different object relationship mappings according to claim 4, characterized in that: The feature acquisition module is specifically used for: Import the System.Reflection namespace; In the System.Reflection namespace, obtain the type of the data model defined in LINQ to SQL as feature information; Get the TableAttribute attribute defined on the type as feature information; the TableAttribute attribute indicates the correspondence between the class and the table; Get all attributes or fields defined on the type as feature information; Obtain the ColumnAttribute attribute or AssociationAttribute attribute defined on the attribute or field as characteristic information; wherein the ColumnAttribute attribute or AssociationAttribute attribute indicates the correspondence between the attribute or field on the type and the column or relationship of the table; All acquired feature information is combined into the model feature by concatenating character strings.
6. The model migration device under different object relationship mappings according to claim 4, characterized in that: The model migration device under different object relationship mapping is also used for: If you use Code First development for adaptive configuration, use the Add-Migration command to create a new migration and use the Update-Database command to apply the new migration to the database to which Entity Framework 6 is connected.
7. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 3.
8. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 3.