Data processing method, electronic equipment and computer readable storage medium
By generating and classifying model modification events in the low-code platform and merging and generating update instructions based on preset rules, the problem of low efficiency in generating update SQL on the low-code platform is solved, and efficient and reliable data migration is achieved.
Patent Information
- Application Number
- CN202510749582.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-05
- Publication Date
- 2025-09-12
AI Technical Summary
Existing low-code platforms are inefficient when generating update SQL, and are prone to data loss or version update failure, and the reliability of the business form change process is low.
By generating model modification events, storing them in the cache area, and classifying and merging multiple model modification events based on preset processing rules, update instructions are generated without the need for form format conversion, and update SQL is directly generated.
Improves the efficiency of SQL update generation, enhances the reliability of data migration, and avoids data loss and version update failure.
Smart Images

Figure CN120631332A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data processing method, an electronic device, and a computer-readable storage medium. Background Art
[0002] A low-code platform is a software development tool that reduces the amount of handwritten code through a visual interface and pre-built modules. Developers can use low-code platforms to build applications, significantly improving development efficiency.
[0003] In traditional technical solutions, after a developer performs a business form operation (creating or modifying a business form) through a low-code platform, the low-code platform converts the created or modified business form into the corresponding format of the database form. If the low-code platform receives a version release instruction from the developer, it compares the created or modified business form with the unchanged business form stored in the database and generates an update SQL (Structured Query Language) based on the comparison results.
[0004] In the process of generating update SQL on the low-code platform, it is necessary to first convert the created or modified business form into the format corresponding to the database form, and then compare the new and old forms to generate update SQL. The operation procedure is complicated and the existing update SQL generation method is inefficient. Summary of the Invention
[0005] The embodiments of the present application provide a data processing method, an electronic device, and a computer-readable storage medium, which can improve the generation efficiency of update SQL, thereby improving the reliability of data migration.
[0006] In a first aspect, the present application provides a data processing method, the method comprising: in response to a received first model modification instruction, generating a model modification event, the model modification event including at least a modification object identifier. The model modification event is stored in a cache area, the cache area is used to store multiple model modification events, the multiple model modification events correspond one-to-one to the multiple modification object identifiers, and the multiple modification object identifiers are not exactly the same. In response to a received merge instruction, the multiple model modification events are classified according to the multiple modification object identifiers to obtain multiple model sets, the first model set includes at least one model modification event, the at least one modification object identifier corresponding to the at least one model modification event is the same, and the first model set is any one of the multiple model sets. Based on a preset processing rule, the first update instruction corresponding to the first model set is determined to obtain multiple update instructions, and the multiple update instructions correspond one-to-one to the multiple model sets.
[0007] In some embodiments, determining a first update instruction corresponding to a first model set based on multiple model sets based on a preset processing rule includes: determining whether a merge event exists in the first model set; if a merge event exists in the first model set, merging at least one model modification event in the first model set according to the preset processing rule to obtain a first merge event; and determining the first update instruction based on the first merge event.
[0008] In some embodiments, the model modification event also includes an event time and a modification object type, and the modification object type corresponding to the model modification event is a field type, a method type, or an index type. According to a preset processing rule, at least one model modification event in the first model set is merged to obtain a first merged event, including: classifying at least one model modification event in the first model set according to the modification object type to obtain at least one classification list, wherein the modification object types corresponding to the model modification events in the first classification list are all field types, or all method types, or all index types, the model modification events in the first classification list are arranged according to event time, and the first classification list is any one of the at least one classification list. According to the preset processing rule, at least one classification list is merged to obtain the first merged event.
[0009] In some embodiments, merging at least one classification list according to a preset processing rule to obtain a first merged event includes: if the last model modification event in the first classification list is a deletion event, determining that a first sub-event corresponding to the first classification list is a deletion event, obtaining at least one sub-event corresponding to the at least one classification list, the first sub-event being a sub-event of the first merged event, and determining the first merged event based on the at least one sub-event.
[0010] In some embodiments, merging at least one classification list according to a preset processing rule to obtain a first merged event includes: if all model modification events in the first classification list are model modification events of continuous change, determining a first sub-event corresponding to the first classification list as a modification event corresponding to the last model modification event in the first classification list, obtaining at least one sub-event corresponding to the at least one classification list, the first sub-event being a sub-event of the first merged event, and determining the first merged event based on the at least one sub-event.
[0011] In some embodiments, merging at least one classification list according to a preset processing rule to obtain a first merged event includes: if the first model modification event in the first classification list is a new event, determining that a first sub-event corresponding to the first classification list is a new event, obtaining at least one sub-event corresponding to the at least one classification list, the first sub-event being a sub-event of the first merged event, and determining the first merged event based on the at least one sub-event.
[0012] In some embodiments, after determining, based on a preset processing rule, a first update instruction corresponding to the first model set and obtaining multiple update instructions corresponding to multiple model sets, the method further includes determining whether the field types corresponding to at least one field in the first update instruction are all the same as the field types corresponding to the first update instruction. If not, changing the at least one field that has a different field type than the field type corresponding to the first update instruction to a null field.
[0013] In some embodiments, after determining, based on a preset processing rule, a first update instruction corresponding to the first model set and obtaining multiple update instructions corresponding to multiple model sets, the process further includes: generating a first rollback instruction corresponding to the first update instruction and obtaining multiple rollback instructions corresponding to the multiple update instructions. Database migration is performed based on the multiple update instructions and the multiple rollback instructions.
[0014] In a second aspect, the present application provides a data processing device, comprising: a receiving module and a processing module;
[0015] The receiving module is configured to generate a model modification event in response to a received first model modification instruction, where the model modification event at least includes a modification object identifier.
[0016] A processing module is used to store model modification events in a cache area. The cache area stores multiple model modification events. The multiple model modification events correspond one-to-one to multiple modification object identifiers. The multiple modification object identifiers are not exactly the same. The model modification event includes the modification object identifier. The model modification event is any one of the multiple model modification events.
[0017] The receiving module is also used to respond to the received merge instruction and classify multiple model modification events according to multiple modification object identifiers to obtain multiple model sets, wherein the first model set includes at least one model modification event, and at least one modification object identifier corresponding to at least one model modification event is the same, and the first model set is any one of the multiple model sets.
[0018] The processing module is further configured to determine a plurality of update instructions based on a preset processing rule and according to a plurality of model sets, wherein the plurality of update instructions correspond one-to-one to the plurality of model sets.
[0019] In a third aspect, the present application provides a chip, which is used to execute any method in the first aspect above.
[0020] In a fourth aspect, the present application provides an electronic device, comprising a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to implement the method as described in any one of the first aspects above. Alternatively,
[0021] The electronic device includes the chip according to the third aspect.
[0022] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method as described in any one of the above-mentioned first aspects.
[0023] In a sixth aspect, the present application provides a computer program product, which stores a computer program, and when the computer program is executed by a processor, implements the method as described in any one of the first aspects above.
[0024] In the technical solution provided by the present application, the terminal device can generate a model modification event in response to the received first model modification instruction, and the model modification event includes at least a modification object identifier. The model modification event is stored in a cache area, and the cache area is used to store multiple model modification events. The multiple model modification events correspond one-to-one to the multiple modification object identifiers, and the multiple modification object identifiers are not exactly the same. And in response to the received merge instruction, the multiple model modification events are classified according to the multiple modification object identifiers to obtain multiple model sets. The first model set includes at least one model modification event, and the at least one modification object identifier corresponding to the at least one model modification event is the same. The first model set is any one of the multiple model sets. Then, based on the preset processing rules, the first update instruction corresponding to the first model set is determined to obtain multiple update instructions, and the multiple update instructions correspond one-to-one to the multiple model sets. The present application does not require form format conversion, can improve the generation efficiency of update SQL, and thus improve the reliability of data migration. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0026] Figure 1 This is a schematic diagram of a business form provided in an embodiment of the present application;
[0027] Figure 2 This is a schematic diagram of an update instruction generation process of a data processing method provided in an embodiment of the present application;
[0028] Figure 3 This is a user interface diagram of a data processing method provided in an embodiment of the present application;
[0029] Figure 4 This is a schematic diagram of a model modification event classification method of a data processing method provided in an embodiment of the present application;
[0030] Figure 5 This is a schematic diagram of a rule engine application method for a data processing method provided in an embodiment of the present application;
[0031] Figure 6 This is a diagram showing the differences and comparisons of model components of a data processing method provided in an embodiment of the present application;
[0032] Figure 7 This is a schematic diagram of a method for changing a field type in a data processing method provided in an embodiment of the present application;
[0033] Figure 8 is a structural diagram of a data processing device provided in an embodiment of the present application;
[0034] Figure 9 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] In the following description, specific details such as specific system structures and technologies are provided for illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obstructing the description of the present application with unnecessary details.
[0036] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0037] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0038] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0039] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0040] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0041] Low-code platforms can replace traditional coding with a graphical interface, lower the technical threshold, and accelerate the software / system development process. Existing low-code platforms usually develop software through form components. For example, developers can perform business form operations (create business forms or modify business forms) through the graphical interface of the low-code platform. Since the business form structure created or modified by the developer is consistent with the form structure of the database, the low-code platform converts the created or modified business form into the format corresponding to the database form in response to the developer's business form operation. If the low-code platform receives a version release instruction issued by the developer, the low-code platform will compare the created or modified business form with the unchanged business form stored in the database, and generate an update SQL based on the comparison results.
[0042] However, comparing the complete information of the new (created or modified business form) and the old (unchanged business form stored in the database) forms requires considerable computing power and time. Furthermore, when generating update SQL on a low-code platform, the created or modified business form must first be converted to the database's corresponding format, and then the new and old forms must be compared to generate the update SQL. This cumbersome operation procedure makes existing methods for generating update SQL inefficient.
[0043] For example, Figure 1 A business form diagram provided for this application. Figure 1 As shown, the business form can include table name and new fields. New fields can include field name, field length and field type. Figure 1Three different fields are added, namely field 1, field 2 and field 3. The field length of field 1 is 36 and the field type is type 1. The field length of field 2 is 50 and the field type is type 1. The field length of field 3 is 0 and the field type is type 2. Figure 1 The corresponding update SQL is alter table add column... (add a column to the old table).
[0044] In addition, the existing update SQL generation method does not process the original data in the database, which can easily lead to data loss or software / system version update failure.
[0045] For example, if the system to be updated is a library management system, some data is stored in the library management system before the update, and the attribute type of some fields is string type, while the field type of the data modified by the developer is numeric type. At this time, the data format in the database is not uniform. If the library management system is updated based on inconsistent data, it may cause the data originally stored in the library management system to be lost, or the update of the library management system may fail.
[0046] On the other hand, when low-code platforms generate and update SQL statements, if one or more business forms need to be modified, multiple different operations must be performed during the modification of any of these forms. If one operation fails, all previous operations cannot be rolled back, resulting in data confusion and low reliability of the business form modification process.
[0047] In view of this, the present application provides a data processing method that can improve the efficiency of generating update SQL, thereby improving the reliability of data migration.
[0048] The technical solution provided in the embodiment of the present application can be applied to a low-code platform. The low-code platform can include an updated SQL generation engine. The low-code platform can be installed on a terminal device (such as a computer, a personal computer, a PC (Personal Computer), etc.). Developers can interact with the low-code platform through the UI (User Interface) of the terminal device. It can be installed on a remote device or on the local end, and this application does not limit this. The embodiment of the present application takes the low-code platform installed on the local end as an example to illustrate the data processing method provided in the embodiment of the present application.
[0049] Figure 2 A schematic diagram of an update instruction generation process of a data processing method provided in an embodiment of the present application. Figure 2 As shown, the update instruction is an update SQL. The update instruction generation process provided in the embodiment of the present application may include the following steps:
[0050] Step S201: In response to a received first model modification instruction, a model modification event is generated, where the model modification event at least includes a modification object identifier.
[0051] In the embodiment of the present application, the developer can send a model modification instruction to the terminal device through the UI interface (front end) of the terminal device. In response to the received model modification instruction, the model modification module of the terminal device generates a model modification event corresponding to the model modification instruction.
[0052] For example, Figure 3 A user interface diagram of a data processing method provided in an embodiment of the present application. Figure 3 As shown, the user interface may include the model name, field name, field type, and field length. Figure 3 Three different fields are added, namely id, test and t2. The field type of id is ID and the field length of id is 0. The field type of test is date and the field length of test is 255. The field type of t2 is integer and the field length of t2 is 255.
[0053] Step S202: storing the model modification event in a cache area. The cache area is used to store multiple model modification events. The multiple model modification events correspond to multiple modification object identifiers one by one. The multiple modification object identifiers are not completely the same.
[0054] Each time the terminal device receives a model modification event, it stores the model modification event in a cache area. The cache area then accumulates multiple model modification events.
[0055] Illustratively, the multiple model modification events may be: add field A event, modify field B event, delete field C event, ... add model event.
[0056] Each model modification event includes at least a modification object identifier (ie, modification object ID) corresponding to the model modification event.
[0057] In some embodiments, each model modification event may further include an event time (ie, the time when the model modification event is generated) and a modification object type, which may be a field type, a method type, or an index type.
[0058] In some embodiments, each model modification event may further include an event type, a modification object name, a model ID, and a model name. The event type may include: modifying basic model information, modifying a model field, modifying a model index, deleting a model, creating a model, deleting a model field, or creating a model field.
[0059] Step S203: In response to the received merge instruction, multiple model modification events are classified according to multiple modification object identifiers to obtain multiple model sets, where the first model set includes at least one model modification event, and at least one modification object identifier corresponding to at least one model modification event is the same. The first model set is any one of the multiple model sets.
[0060] After adding multiple model modification instructions, developers can click "Preview" on the UI interface (i.e., send a merge instruction to the terminal device). In response to the received merge instruction, the terminal device calls the database migration interface and classifies the multiple model modification events according to the multiple modification object identifiers to obtain multiple model sets.
[0061] In the embodiment of the present application, the terminal device can classify multiple model modification events according to the modification object identifier to obtain multiple model sets. The modification object identifier corresponding to the model modification event in each model set is the same modification object identifier.
[0062] In some embodiments, the terminal device may further classify multiple model modification events according to the modified object identifier, event time, and modified object type.
[0063] For example, Figure 4 This is a schematic diagram of a model modification event classification method for a data processing method provided in an embodiment of the present application. Figure 4 As shown, the terminal device can classify multiple model modification events according to the modification object identifier to obtain multiple model sets, namely model 1, model 2...model N. And each model set is divided into multiple classification lists according to the modification object type, namely the field list corresponding to the field type, the method list corresponding to the method type, and the index list corresponding to the index type. The model modification events in each classification list are arranged in the order of event time. The field list corresponding to model 1 includes the event list corresponding to field 1, the event list corresponding to field 2...the event list corresponding to field N. The method list corresponding to model 1 includes the event list corresponding to method 1, the event list corresponding to method 2...the event list corresponding to method N. The index list corresponding to model 1 includes the event list corresponding to index 1, the event list corresponding to index 2...the event list corresponding to index N.
[0064] Step S204: Based on a preset processing rule, determine a first update instruction corresponding to the first model set, and obtain multiple update instructions, where the multiple update instructions correspond one-to-one to the multiple model sets.
[0065] In the embodiment of the present application, the preset processing rule may be a preset rule engine, and the terminal device may generate multiple update instructions (ie, update SQL) according to the rule engine.
[0066] For example, Figure 5 As shown in FIG, a schematic diagram of a rule engine application method of a data processing method provided by an embodiment of the present application is provided. Developers can modify the model at the front end of the terminal device. The model modification module of the terminal device generates a model modification event in response to the received model modification instruction, and caches the model modification event in the cache area of the database migration module, such as Figure 5 As shown, the cache area stores multiple events: add field A event, modify field B event, delete field C event, and so on, add model event. After the developer has edited all model modification instructions, he can click Preview on the front end, issue a merge instruction, and preview the model modification events corresponding to all model modification instructions. In response to the received merge instruction, the terminal device constructs and executes the update SQL through the rule engine to update the database. The database contains a low-code model table for storing the database's operating data.
[0067] In an embodiment of the present application, a method for a terminal device to determine a first update instruction corresponding to a first model set based on a preset processing rule may include: first, determining whether a merge event exists in the first model set; if a merge event exists in the first model set, merging at least one model modification event in the first model set according to the preset processing rule to obtain a first merge event; and then determining a first update instruction based on the first merge event.
[0068] For example, for any one model set (a first model set) among the multiple model sets, the first model set can be divided into multiple classification lists, namely, a field list, a method list, and an index list. The terminal device can merge the model modification events in at least one classification list according to the time event sequence according to the preset processing rules to obtain a first merged event. The terminal device can also determine the first update instruction based on the first merged event.
[0069] The terminal device merges at least one classification list according to a preset processing rule to obtain a first merge event. The method may include: if the last model modification event in the first classification list is a delete event, determining that a first sub-event corresponding to the first classification list is a delete event, obtaining at least one sub-event corresponding to the at least one classification list, the first sub-event being a sub-event of the first merge event, and determining the first merge event based on the at least one sub-event.
[0070] For example, the terminal device can determine whether there is a delete event in the first classification list. If there is a delete event in the first classification list and the delete event is the last event in the first classification list, the terminal device can determine that the first sub-event is a delete event and generate a sub-update instruction corresponding to the first sub-event as a delete SQL. If there is a delete event in the first classification list and the delete event is not the last event in the first classification list, the terminal device does not need to generate a delete SQL.
[0071] In some embodiments, the method for determining multiple update instructions by the terminal device based on a preset processing rule and according to multiple model sets may further include:
[0072] If all model modification events in the first classification list are model modification events that are continuously changed, a first sub-event corresponding to the first classification list is determined to be the modification event corresponding to the last model modification event in the first classification list. At least one sub-event corresponding to at least one classification list is obtained, and the first sub-event is a sub-event of the first merged event. A first merged event is determined based on the at least one sub-event.
[0073] For example, if there are two consecutive model modification events in the first classification list, the first model modification event is to change the model field name from bird to falcon, and the second model modification event is to change the model field name from falcon to pigeon, the terminal device can merge the first model modification event and the second model modification event to generate a first sub-event with the modified name being pigeon, and the first sub-update instruction corresponding to the first sub-event is the SQL with the modified name being pigeon.
[0074] In some embodiments, the method for determining multiple update instructions by the terminal device based on a preset processing rule and according to multiple model sets may further include:
[0075] If the first model modification event in the first classification list is a new event, then the first sub-event corresponding to the first classification list is determined to be a new event, and at least one sub-event corresponding to at least one classification list is obtained, where the first sub-event is a sub-event of the first merged event. The first merged event is determined based on the at least one sub-event.
[0076] For example, if there is a new event in the first classification list, and the new event is the first event in the first classification list, it indicates that this component did not exist before the new event, and the first sub-event is a new event, and the first sub-update instruction corresponding to the first sub-event is a create SQL statement. If there is a new event in the first classification list, and the new event is not the first event in the first classification list, it indicates that the new event is an event created after the delete event, and this component existed before the new event, and the first sub-event is an update event, and the first sub-update instruction corresponding to the first sub-event is an update SQL statement.
[0077] In some embodiments, the method for determining multiple update instructions by the terminal device based on a preset processing rule and according to multiple model sets may further include:
[0078] The first category list is grouped by attribute type. For example, an attribute type may include a field name, a field type, and a field length. All attribute modification events in the first category list are traversed, and the latest attribute value is used as the updated value. Update SQL is generated. It should be understood that the create component contains the latest attribute value, or the update component contains the latest attribute value.
[0079] In some embodiments, based on a preset processing rule and according to a plurality of model sets, the method for determining a plurality of update instructions may further include:
[0080] If there is a create event in the first category list, create the corresponding update SQL.
[0081] In some embodiments, the method for determining multiple update instructions by the terminal device based on a preset processing rule and according to multiple model sets may further include:
[0082] If there is a model adding sub-model event in the first classification list, the terminal device generates an update SQL for adding a sub-model field to the table of the parent model corresponding to the sub-model.
[0083] In some embodiments, the method for determining multiple update instructions by the terminal device based on a preset processing rule and according to multiple model sets may further include:
[0084] If there is an event in which a model is added to cover a model in the first classification list, the terminal device generates an update SQL for adding a new covering model field to the table corresponding to the covered model.
[0085] In the technical solution provided by the embodiment of the present application, the terminal device can generate a model modification event in response to the received first model modification instruction, and the model modification event includes at least a modification object identifier. The model modification event is stored in a cache area, and the cache area is used to store multiple model modification events. The multiple model modification events correspond one-to-one to the multiple modification object identifiers, and the multiple modification object identifiers are not exactly the same. And in response to the received merge instruction, the multiple model modification events are classified according to the multiple modification object identifiers to obtain multiple model sets, the first model set includes at least one model modification event, and the at least one modification object identifier corresponding to the at least one model modification event is the same, and the first model set is any one of the multiple model sets. Then, based on the preset processing rules, the first update instruction corresponding to the first model set is determined to obtain multiple update instructions, and the multiple update instructions correspond one-to-one to the multiple model sets. The technical solution provided by the embodiment of the present application does not require form format conversion, can improve the generation efficiency of update SQL, and thus improve the reliability of data migration.
[0086] In some embodiments, after the terminal device performs step S204 above and determines multiple update instructions based on multiple model sets, the method further includes: generating a first rollback instruction corresponding to the first update instruction, obtaining multiple rollback instructions corresponding to the multiple update instructions, where the first update instruction is any one of the multiple update instructions, and performing database migration based on the multiple update instructions and the multiple rollback instructions.
[0087] For example, if there are 5 update instructions, if the first update instruction and the second update instruction are both executed successfully, and the third update instruction fails to execute, the terminal device can perform a rollback operation according to the rollback instruction corresponding to the third update instruction, and roll back the database to the state before the first update instruction and the second update instruction are executed to ensure the consistency of the database and be compatible with different databases, such as MySql (My Structured Query Language, a relational database) or postgreSql (relational database management system).
[0088] For example, Figure 6A difference comparison information diagram of the model components of a data processing method provided in an embodiment of the present application. The model double-precision floating-point information list may include the model ID, the old application, the new application, the old model name, the new model name, the index double-precision floating-point information list, the normal field information library list, and the relationship field database information list. The index double-precision floating-point information list includes: the index name, the modification type, the index type enumeration, and the relationship field list. The normal field information library list includes: the old field name, the new field name, the old maximum length, and the new maximum length. The relationship field database information list includes: the old field name, the new field name, the old model name, the new model name, the field ID, the old target model name, the new target model name, the old target model, the new target model, the old connection table, and the new connection table.
[0089] In some embodiments, after the terminal device performs step S204 above and determines multiple update instructions based on multiple model sets, the step further includes: determining whether the field types corresponding to at least one field in the first update instruction are all the field types corresponding to the first update instruction, and the first update instruction is any one of the multiple update instructions. If not, changing the field type of the at least one field that is different from the field type corresponding to the first update instruction to a blank field.
[0090] For example, Figure 7 A schematic diagram of a method for changing a field type in a data processing method provided in an embodiment of the present application. If the field type corresponding to the first update instruction is an integer, i.e., a numeric type, and the field type corresponding to at least one field in the first update instruction is a string type, the terminal device changes the at least one field that has a different field type than the field type corresponding to the first update instruction to a null field (NULL). Figure 7 (a) is a diagram of the field type before the change. Before the change, the author corresponding to name 1 is 134, which is an integer, and the author corresponding to name 2 is abc, which is a string. Figure 7 (b) is a diagram of the field type after the change. After the change, the author corresponding to name 1 is 134, which is an integer, and the author corresponding to name 2 is NULL, which is an empty field.
[0091] The technical solution provided by the embodiment of the present application is compatible with the original records in the database, retains database records with compatible field types, and changes incompatible database records, which can avoid the loss of original records and facilitate database migration.
[0092] It should be understood that, provided there is no logical conflict, the above-mentioned embodiments can be combined with each other to meet actual application requirements. The specific embodiments or implementation plans obtained by these combinations still fall within the scope of protection of this application.
[0093] Corresponding to the data processing method in the above embodiment, an embodiment of the present application provides a data processing device, which can be a label allocation device. The label allocation device is provided with a label forwarding information table, and the label forwarding information table includes at least one forwarding equivalence class. The data processing device can be implemented by software, hardware, or a combination of both to become part or all of a computer device, and is used to execute the steps in the data processing method in the above embodiment.
[0094] Figure 8 A structural diagram of a data processing device 80 provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0095] Reference Figure 8 , the device 80 includes a receiving module 810 and a processing module 820.
[0096] The receiving module 810 is configured to generate a model modification event in response to a received first model modification instruction, where the model modification event at least includes a modification object identifier.
[0097] The processing module 820 is used to store the model modification event in a cache area. The cache area is used to store multiple model modification events. The multiple model modification events correspond to multiple modification object identifiers one by one. The multiple modification object identifiers are not completely the same.
[0098] The receiving module 810 is also used to classify multiple model modification events according to multiple modification object identifiers in response to the received merge instruction to obtain multiple model sets, where the first model set includes at least one model modification event, and at least one modification object identifier corresponding to at least one model modification event is the same, and the first model set is any one of the multiple model sets.
[0099] The processing module 820 is further configured to determine, based on a preset processing rule, a first update instruction corresponding to the first model set, and obtain multiple update instructions, where the multiple update instructions correspond one-to-one to the multiple model sets.
[0100] In some embodiments, the processing module 820 is specifically configured to: determine whether a merge event exists in the first model set; if a merge event exists in the first model set, merge at least one model modification event in the first model set according to a preset processing rule to obtain a first merge event, thereby obtaining multiple merge events, wherein the multiple merge events correspond one-to-one to the multiple model sets; determine a first update instruction based on the first merge event, and obtain multiple update instructions corresponding to the multiple merge events.
[0101] In some embodiments, the model modification event also includes event time and modification object type. The modification object type corresponding to the model modification event is field type, method type, or index type. The processing module 820 is specifically used to: classify at least one model modification event in the first model set according to the modification object type to obtain at least one classification list. The modification object types corresponding to the model modification events in the first classification list are all field type, or all method type, or all index type. The model modification events in the first classification list are arranged according to event time. The first classification list is any one of the at least one classification list. According to the preset processing rules, at least one classification list is merged to obtain a first merged event.
[0102] In some embodiments, processing module 820 is specifically configured to: if the last model modification event in the first classification list is a deletion event, determine that a first sub-event corresponding to the first classification list is a deletion event, obtain at least one sub-event corresponding to at least one classification list, where the first sub-event is a sub-event of the first merge event, and determine the first merge event based on the at least one sub-event.
[0103] In some embodiments, the processing module 820 is specifically configured to: if all model modification events in the first classification list are model modification events of continuous change, determine a first sub-event corresponding to the first classification list as the modification event corresponding to the last model modification event in the first classification list, obtain at least one sub-event corresponding to at least one classification list, the first sub-event being a sub-event of the first merged event, and determine the first merged event based on the at least one sub-event.
[0104] In some embodiments, processing module 820 is specifically configured to: if the first model modification event in the first classification list is a new event, determine that the first sub-event corresponding to the first classification list is a new event, obtain at least one sub-event corresponding to at least one classification list, where the first sub-event is a sub-event of the first merged event, and determine the first merged event based on the at least one sub-event.
[0105] In some embodiments, the processing module 820 is further configured to determine whether the field types corresponding to at least one field in the first update instruction are all the field types corresponding to the first update instruction, and if not, change the field of the at least one field that is of a different field type than the field type corresponding to the first update instruction to a null field.
[0106] In some embodiments, the processing module 820 is further configured to: generate a first rollback instruction corresponding to the first update instruction, obtain multiple rollback instructions corresponding to multiple update instructions, and execute database migration according to the multiple update instructions and the multiple rollback instructions.
[0107] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.
[0108] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0109] Based on the same inventive concept, an embodiment of the present application also provides an electronic device.
[0110] Figure 9 Schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 9 As shown, the electronic device 9 of this embodiment includes: at least one processor 910 ( Figure 9 Only one is shown), a memory 920, and a communication module 940. The memory 920 stores a computer program 930 that may be run on the processor 910. When the processor 910 executes the computer program 930, the steps in the above data processing method embodiment are implemented, such as Figure 2 Alternatively, when the processor 910 executes the computer program 930, the functions of the modules / units in the above-mentioned device embodiments are realized, for example Figure 8 The functions of modules 810 to 820 are shown, and the communication module 940 can be a separate communication unit for communicating with an external server or terminal device.
[0111] The electronic device 9 may include, but is not limited to: a processor 910 and a memory 920. Those skilled in the art will appreciate that Figure 9 It is only an example of the electronic device 9 and does not constitute a limitation of the electronic device 9. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 9 may also include an input and sending device, a network access device, a bus, etc.
[0112] The processor 910 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0113] In some embodiments, the memory 920 may be an internal storage unit of the electronic device 9, such as a hard disk or memory of the electronic device 9. The memory 920 may also be an external storage device of the electronic device 9, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash memory card, etc. equipped on the electronic device 9. The memory 920 may also include both an internal storage unit of the electronic device 9 and an external storage device. The memory 920 is used to store an operating system, application programs, a boot loader, data, and other programs, such as the program code of the computer program 930. The memory 920 may also be used to temporarily store data that has been sent or is about to be sent.
[0114] In addition, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units in the various embodiments of the present application can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0115] An embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on an electronic device, the electronic device executes the steps in the above-mentioned method embodiments.
[0116] An embodiment of the present application provides a chip, which includes a processor and a memory. The memory stores a computer program, and when the computer program is executed by the processor, the steps in the above-mentioned method embodiments are implemented.
[0117] An embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the steps in the above-mentioned various method embodiments.
[0118] It should be understood that the processor mentioned in the embodiments of the present application may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0119] It should also be understood that the memory mentioned in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DR RAM).
[0120] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0121] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0122] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0123] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the system embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0124] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0125] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0126] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program, when executed by the processor, can implement the steps of the above-mentioned various method embodiments. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include at least: any entity or device capable of carrying the computer program code to a large-screen device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0127] Finally, it should be noted that the above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A data processing method, characterized in that: The method comprises: In response to the received first model modification instruction, generating a model modification event, wherein the model modification event includes at least a modification object identifier; Storing the model modification event in a cache area, the cache area is used to store multiple model modification events, the multiple model modification events correspond to multiple modification object identifiers one by one, and the multiple modification object identifiers are not completely the same; In response to the received merge instruction, the multiple model modification events are classified according to the multiple modification object identifiers to obtain multiple model sets, wherein a first model set includes at least one model modification event, at least one modification object identifier corresponding to the at least one model modification event is the same, and the first model set is any one of the multiple model sets; Based on a preset processing rule, a first update instruction corresponding to the first model set is determined, and a plurality of update instructions corresponding to the plurality of model sets are obtained, where the plurality of update instructions correspond one-to-one to the plurality of model sets.
2. The data processing method according to claim 1, wherein: The determining, based on a preset processing rule, a first update instruction corresponding to the first model set includes: Determine whether there is a merge event in the first model set; If a merge event exists in the first model set, merging at least one model modification event in the first model set according to the preset processing rule to obtain a first merge event; The first update instruction is determined according to the first merge event.
3. The data processing method according to claim 2, characterized in that: The model modification event also includes an event time and a modification object type. The modification object type corresponding to the model modification event is a field type, a method type, or an index type. The merging of at least one model modification event in the first model set according to a preset processing rule to obtain a first merged event includes: Classify at least one model modification event in the first model set according to the modification object type to obtain at least one classification list, wherein the modification object types corresponding to the model modification events in the first classification list are all the field type, or all the method type, or all the index type, and the model modification events in the first classification list are arranged according to the event time, and the first classification list is any one of the at least one classification list; According to preset processing rules, the at least one classification list is merged to obtain the first merge event.
4. The data processing method according to claim 3, wherein: The merging of the at least one classification list according to a preset processing rule to obtain the first merging event includes: If the last model modification event in the first classification list is a deletion event, determining that the first sub-event corresponding to the first classification list is a deletion event, obtaining at least one sub-event corresponding to the at least one classification list, the first sub-event being a sub-event of the first merge event; The first merge event is determined according to the at least one sub-event.
5. The data processing method according to claim 3, wherein: The merging of the at least one classification list according to a preset processing rule to obtain the first merging event includes: If all the model modification events in the first classification list are model modification events of continuous change, determining that a first sub-event corresponding to the first classification list is a modification event corresponding to the last model modification event in the first classification list, obtaining at least one sub-event corresponding to the at least one classification list, the first sub-event being a sub-event of the first merge event; The first merge event is determined according to the at least one sub-event.
6. The data processing method according to claim 3, characterized in that: The merging of the at least one classification list according to a preset processing rule to obtain the first merging event includes: If the first model modification event in the first classification list is a new event, determining that the first sub-event corresponding to the first classification list is a new event, obtaining at least one sub-event corresponding to the at least one classification list, the first sub-event being a sub-event of the first merged event; The first merge event is determined according to the at least one sub-event.
7. The data processing method according to any one of claims 1 to 6, characterized in that: After the step of determining the first update instruction corresponding to the first model set based on the preset processing rule and obtaining the multiple update instructions corresponding to the multiple model sets, the method further includes: determining whether the field types corresponding to at least one field in the first update instruction are all the field types corresponding to the first update instruction; If not, the field of the at least one field that is different in type from the field corresponding to the first update instruction is changed to an empty field.
8. The data processing method according to any one of claims 1 to 6, characterized in that: After the step of determining the first update instruction corresponding to the first model set based on the preset processing rule and obtaining the multiple update instructions corresponding to the multiple model sets, the method further includes: Generate a first rollback instruction corresponding to the first update instruction, and obtain multiple rollback instructions corresponding to the multiple update instructions; Database migration is performed according to the multiple update instructions and the multiple rollback instructions.
9. An electronic device, characterized in that: The device comprises a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to implement the data processing method as claimed in any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the data processing method as described in any one of claims 1 to 8 is implemented.