Data modification method and device, computer equipment, readable storage medium and program product
By obtaining and executing a list of data modification scripts for application components, the problem of inefficient data modification in the prior art is solved, and an efficient and accurate data modification process is achieved.
Patent Information
- Application Number
- CN202411432503.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-02-11
AI Technical Summary
The prior art is inefficient when modifying data on application systems that deploy a large number of application components, and it is time-consuming and labor-consuming to develop data and modify code for each application component.
Provide a data modification method, by obtaining a component data modification list, including component data modification scripts for each application component, and gradually obtaining and executing corresponding data modification scripts based on the indicated data modification requirements to realize data modification of the application system.
Improve the efficiency of data modification, without the need to develop corresponding data modification code for each application component, simplify the data modification process, and ensure the accuracy of data modification through segmented data modification.
Smart Images

Figure CN119415173A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data technology, and in particular to a data modification method, apparatus, computer equipment, readable storage medium and program product. Background Art
[0002] With the rapid development of big data, data modification has become one of the essential operations to ensure the stable operation of application systems. As far as current application systems are concerned, they often contain a large number of application components. Therefore, when modifying data in application systems, each application component also needs to be considered.
[0003] In the prior art, in order to meet the data modification needs of an application system with a large number of application components deployed, a corresponding data modification code is usually developed for each application component, and then the data modification code is run to complete the data modification of each application component, thereby realizing the data modification of the entire application system. However, this method is time-consuming and labor-intensive, and there is a problem of low data modification efficiency. Summary of the invention
[0004] Based on this, it is necessary to provide a data modification method, apparatus, computer device, computer-readable storage medium and computer program product that can improve data modification efficiency in response to the above technical problems.
[0005] In a first aspect, the present application provides a data modification method, comprising: in response to component data modification instructions for multiple application components, obtaining a component data modification list; the component data modification list includes a component data modification script for each application component; based on the component data modification requirements indicated by the component data modification instructions, obtaining a first data modification script for the target component in the data modification list; the target component is any one or more components in each application component; based on the first data modification script, modifying the component data of the target component to obtain a first data modification result of the target component; when the first data modification result is a normal result, obtaining a second data modification script for other components in each application component except the target component in the data modification list; based on the second data modification script, modifying the component data of other components to obtain second data modification results of other components; summarizing the first data modification result and the second data modification result to obtain a component data modification result.
[0006] In one of the embodiments, in response to component data modification instructions for multiple application components, a component data modification list is obtained, including: in response to component data modification instructions for multiple application components, performing association analysis between the application components to obtain association analysis results between the application components; when the association analysis results indicate that there is no association between the application components, aggregating the component data modification scripts to obtain a component data modification list.
[0007] In one of the embodiments, the method also includes: obtaining an initial data modification list; the initial data modification list includes a data modification directory for each application component; aggregating the data modification scripts of each component to obtain a component data modification list, including: in each data modification directory, determining a target modification directory that matches each component data modification script; when each component data modification script is added to the matching target modification directory, a component data modification list is obtained.
[0008] In one of the embodiments, based on the component data modification requirements indicated by the component data modification instructions, a first data modification script of the target component is obtained in the data modification list, including: based on the component data modification requirements indicated by the component data modification instructions, determining the number of target components that match the component data modification requirements; in each application component, screening out the target components that match the number of target components; in the data modification list, obtaining the first data modification script of the target component.
[0009] In one of the embodiments, component data of a target component is modified based on a first data modification script, including: obtaining script information of the first data modification script; matching the script information with list information of a data modification list to obtain an information matching result; and when the information matching result indicates that the match passes, modifying the component data of the target component.
[0010] In one of the embodiments, the method further includes: if a data modification instruction for each application component is received, obtaining the data modification status of each application component respectively; when the data modification status indicates that the data modification is not completed, performing data modification confirmation again for the application component.
[0011] In the second aspect, the present application also provides a data modification device, including: a list acquisition module, used to obtain a component data modification list in response to component data modification instructions for multiple application components; the component data modification list includes a component data modification script for each application component; a first script acquisition module, used to obtain a first data modification script for a target component in the data modification list based on the component data modification requirements indicated by the component data modification instructions; the target component is any one or more components in each application component; the first data modification module, used to modify the component data of the target component based on the first data modification script, and obtain a first data modification result of the target component; the second script acquisition module, used to obtain, in the data modification list, a second data modification script for other components in each application component except the target component when the first data modification result is a normal result; the second data modification module, used to modify the component data of other components based on the second data modification script, and obtain second data modification results of other components; a data aggregation module, used to aggregate the first data modification result and the second data modification result to obtain a component data modification result.
[0012] In one of the embodiments, the list acquisition module also includes: a correlation analysis unit, which is used to respond to component data modification instructions for multiple application components, analyze the correlation relationship between the application components, and obtain the correlation analysis results between the application components; a summary unit, which is used to summarize the component data modification scripts to obtain a component data modification list when the correlation analysis results indicate that there is no correlation relationship between the application components.
[0013] In one of the embodiments, the device is also used to: obtain an initial data modification list; the initial data modification list includes a data modification directory for each application component; the summary unit is also used to: in each data modification directory, determine a target modification directory that matches each component data modification script; when each component data modification script is added to the matching target modification directory, a component data modification list is obtained.
[0014] In one of the embodiments, the first script acquisition module is further used to: determine the number of target components that match the component data modification requirements based on the component data modification requirements indicated by the component data modification instruction; screen out target components that match the target component number in each application component; and obtain the first data modification script of the target component in the data modification list.
[0015] In one of the embodiments, the first data modification module is further used to: obtain script information of the first data modification script; match the script information with the list information of the data modification list to obtain an information matching result; and modify component data of the target component when the information matching result indicates that the match passes.
[0016] In one of the embodiments, the device is also used to: if a data modification instruction for each application component is received, obtain the data modification status of each application component respectively; when the data modification status indicates that the data modification is not completed, confirm the data modification again for the application component.
[0017] In a third aspect, the present application also provides a computer device, comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program: in response to component data modification instructions for multiple application components, obtaining a component data modification list; the component data modification list includes a component data modification script for each application component; based on the component data modification requirements indicated by the component data modification instructions, obtaining a first data modification script for the target component in the data modification list; the target component is any one or more components in each application component; based on the first data modification script, modifying the component data of the target component to obtain a first data modification result of the target component; when the first data modification result is a normal result, obtaining a second data modification script for other components in each application component except the target component in the data modification list; based on the second data modification script, modifying the component data of other components to obtain second data modification results of other components; summarizing the first data modification result and the second data modification result to obtain a component data modification result.
[0018] In a fourth aspect, the present application also provides a computer-readable storage medium having a computer program stored thereon, which implements the following steps when executed by a processor: in response to component data modification instructions for multiple application components, obtain a component data modification list; the component data modification list includes a component data modification script for each application component; based on the component data modification requirements indicated by the component data modification instructions, obtain a first data modification script for the target component in the data modification list; the target component is any one or more components in each application component; based on the first data modification script, modify the component data of the target component to obtain a first data modification result of the target component; when the first data modification result is a normal result, obtain a second data modification script for other components in each application component except the target component in the data modification list; based on the second data modification script, modify the component data of other components to obtain second data modification results of other components; summarize the first data modification result and the second data modification result to obtain a component data modification result.
[0019] In a fifth aspect, the present application also provides a computer program product, comprising a computer program, which implements the following steps when executed by a processor: in response to component data modification instructions for multiple application components, obtain a component data modification list; the component data modification list includes a component data modification script for each application component; based on the component data modification requirements indicated by the component data modification instructions, obtain a first data modification script for the target component in the data modification list; the target component is any one or more components in each application component; based on the first data modification script, modify the component data of the target component to obtain a first data modification result of the target component; when the first data modification result is a normal result, obtain a second data modification script for other components in each application component except the target component in the data modification list; based on the second data modification script, modify the component data of other components to obtain second data modification results of other components; summarize the first data modification result and the second data modification result to obtain a component data modification result.
[0020] The above-mentioned data modification method, device, computer equipment, computer-readable storage medium and computer program product, when receiving component data modification instructions for multiple application components, first obtain a component data modification list including the component data modification script of each application component, so as to perform subsequent data modification for each application component based on the component data modification list. Further, considering that if data modification is performed on all application components at one time, all data modification results may be wrong due to certain influencing factors. Therefore, the present application selects the first data modification script of the target component based on the component data modification requirements in the data modification list, and the target component is any one or more components in each application component. Thus, based on the first data modification script, a round of component data modification is first performed on the target component to obtain the first data modification result. When it is confirmed that the first data modification result is a normal result, it means that the data modification is performed normally. At this time, based on the second data modification script of other components except the target component in the data modification list, the component data of other components is modified to obtain the second data modification results of other components. Finally, the first data modification result and the second data modification result are summarized to obtain the final component data modification result. In this way, on the one hand, this application collects the data modification scripts of each application component into a data modification list to achieve the uniformity of data modification, without the need to develop corresponding data modification codes for each application component, thereby effectively improving the efficiency of data modification. On the other hand, the segmented data modification method is adopted to ensure the accuracy of data modification. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0022] FIG1 is an application environment diagram of a data modification method in one embodiment;
[0023] FIG2 is a schematic diagram of a flow chart of a data modification method in one embodiment;
[0024] FIG3 is a schematic diagram of a component data modification list in one embodiment;
[0025] FIG4 is a schematic diagram of a process of analyzing association relationships between components in one embodiment;
[0026] FIG5 is a schematic diagram of a process for generating a component data modification list in one embodiment;
[0027] FIG6 is a schematic diagram of a process of obtaining a first data modification script in one embodiment;
[0028] FIG7 is a schematic diagram of a process of information matching in one embodiment;
[0029] FIG8 is a schematic diagram of a process flow of secondary confirmation of data modification in one embodiment;
[0030] FIG9 is a schematic flow chart of a data modification method in a specific embodiment;
[0031] FIG10 is a structural block diagram of a data modification device in one embodiment;
[0032] FIG. 11 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0034] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations. The acquisition, storage, use, and processing of data in the technical solution of this application are in compliance with relevant provisions of national laws and regulations.
[0035] The data modification method provided in the embodiment of the present application can be applied in the application environment shown in FIG. 1. The terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. In response to the component data modification instruction for multiple application components initiated by the terminal 102, the server 104 first obtains a component data modification list; the component data modification list includes a component data modification script for each application component; based on the component data modification requirements indicated by the component data modification instruction, in the data modification list, a first data modification script of the target component is obtained; the target component is any one or more components in each application component; based on the first data modification script, the component data of the target component is modified to obtain the first data modification result of the target component; when the first data modification result is a normal result, in the data modification list, a second data modification script of other components other than the target component in each application component is obtained; based on the second data modification script, the component data of other components is modified to obtain the second data modification result of other components; the first data modification result and the second data modification result are summarized to obtain the component data modification result.
[0036] The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and IoT devices. The server 104 may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.
[0037] In an exemplary embodiment, as shown in FIG. 2 , a data modification method is provided, which is described by taking the method applied to the server 104 in FIG. 1 as an example, and includes the following steps:
[0038] Step S202: in response to component data modification instructions for multiple application components, obtain a component data modification list; the component data modification list includes a component data modification script for each application component.
[0039] Among them, the application component is the basic building block of the application system. The component data modification instruction may refer to an instruction for modifying the data of the application component. It is understandable that when the current application system needs data modification, one or more application components may need to modify the data. If each application component uses its own data modification code to modify the data, this will not only affect the data modification efficiency of the entire application system, but also the quality of data modification is difficult to guarantee. Therefore, a component data modification list is introduced in this embodiment. The component data modification list can be understood as a list containing data modification scripts of each application component. In this embodiment, the component data modification list can be a List file. The List file usually refers to a folder or directory for storing multiple files or other folders. The component data modification script may refer to a script file containing execution statements when the application component performs data modification. In this embodiment, the component data modification script may be an SQL file, which is a file written in structured query language (SQL). In this way, by aggregating the data modification scripts of each application component into a data modification list to achieve the uniformity of data modification, there is no need to develop corresponding data modification codes for each application component, thereby effectively improving the efficiency of data modification.
[0040] In one example, the naming format of the component data modification list can be: component + date + sequence number.list, such as A2024092401.list, where A represents the component and 01 represents the sequence number. The date can be the generation time of the component data modification list. It can be understood that the component in the naming does not limit the application components included in the list, that is, a component data modification list can contain component data modification scripts of different application components, and the component in the naming can be the name of any of these components.
[0041] Exemplarily, when the server receives a component data modification instruction for multiple application components sent by the terminal, it can first obtain a component data modification list, i.e., a List file, which contains the component data modification script, i.e., an SQL file, for each application component. Subsequently, data modification can be performed directly according to the List file. It should be noted that the execution order of the SQL file is the order configured in the List file, which is executed serially, and one line is completed before entering the next line. A List file can only be called and executed once.
[0042] In one example, in the subsequent process of modifying data directly according to the List file, the modification can be performed by a developer, and of course, a suitable data modification tool can be selected for modification according to the actual situation.
[0043] Step S204, based on the component data modification requirement indicated by the component data modification instruction, obtain a first data modification script of a target component in the data modification list; the target component is any one or more components in each application component.
[0044] Among them, the component data modification demand can refer to the business demand for data modification of each application component, which can be used to match the appropriate number of components for the first segment of data modification. It can be understood that in this embodiment, considering that if the data of all application components are modified at one time, all data modification results may be wrong due to certain influencing factors such as data modification tool failure. Therefore, a segmented data modification method is adopted in this embodiment, that is, the target component is first screened out for the first segment of data modification. The target component can be any one or more components in each application component. The first data modification script can refer to the component data modification script of the target component.
[0045] Exemplarily, after obtaining the component data modification list, the server can further determine any one or more target components in each application component according to business needs, and then obtain the component data modification scripts of these target components from the component data modification list to perform the first segment of data modification on these target components.
[0046] In one example, referring to FIG3 , the server may store the component data modification script of the target component in a new component data modification list 1. Similarly, the component data modification scripts of other subsequent components may be stored in another new component data modification list 2. Among them, in addition to the SQL script, the component data modification list may also include the cluster number, the database name corresponding to the component, the component name, the date, and the backup identifier. The cluster number may be understood as a data identifier, which can be used to check each component data modification script before data modification. The backup identifier may refer to an identifier when backing up the component data modification script. It is understandable that the server may back up the component data modification script before the target component / other component is modified for the first segment of data / the second segment of data, and after the target component / other component is modified for the first segment of data / the second segment of data, also known as the backup file, for the convenience of subsequent data tracing. In Figure 3, a1 may represent the backup of component A before the first segment of data is modified, a2 may represent the backup of component A after the first segment of data is modified, b1 may represent the backup of component B before the second segment of data is modified, and b2 may represent the backup of component B after the second segment of data is modified.
[0047] In one example, the component data modification script backed up at each stage can use the same script file, and the select (query) field in the backed-up component data modification script can contain the full primary key and the fields involved in rollback. Rollback is an operation to undo the currently executed command. In this example, the rollback operation can be performed based on the backed-up component data modification script. Specifically, the rollback can be performed in a splicing manner. For example, after the first segment of data is modified, if the modified component data modification script needs to be rolled back, the rollback command can be executed: rollback statement + A2024092401.list. After the second segment of data is modified, if the modified component data modification script needs to be rolled back, the rollback command can be executed: rollback statement + B2024092401.list. If the modified data of the two segments needs to be rolled back after the second segment of data is modified, the rollback statement + A2024092401.list can be executed first, and then the rollback statement + B2024092401.list can be executed. In one example, the rollback statement can be "99rollback".
[0048] It should be noted that this embodiment does not limit the number of component data modification lists, that is, in actual applications, developers can create two different component data modification lists from the beginning to respectively store the component data modification scripts of the target component modified by the first segment of data, and the component data modification scripts of other components modified by the second segment of data. It can also be as described in the above embodiment, that is, the component data modification scripts of all application components are stored in one component data modification list at the beginning, and then the component data modification scripts of the screened target components are stored in a new component data modification list, and the component data modification scripts of other components are stored in another new component data modification list. The specific method can be flexibly adjusted according to the actual situation.
[0049] Step S206: modify the component data of the target component based on the first data modification script to obtain a first data modification result of the target component.
[0050] Among them, the first data modification result may refer to the result obtained after modifying the data of the target component, which may include but is not limited to the modified component data modification script, data modification duration, response rate, data modification accuracy, etc.
[0051] Exemplarily, after the server obtains the component data modification script of the target component, it can modify the data of the target component according to the component data modification script, specifically, it can execute the execution statement contained in the component data modification script to modify the data of the target component, thereby obtaining the data modification result of the target component.
[0052] Step S208: When the first data modification result is a normal result, in the data modification list, obtain the second data modification scripts of other components in each application component except the target component.
[0053] Among them, the normal result can be understood as the first data modification result being a standard value or within a standard value range, and the standard value here can be a value set by the developer. Taking the data modification duration as an example, when the data modification duration is within the standard duration range, the first data modification result is considered to be a normal result. Another example is the data modification accuracy. When the data modification accuracy reaches the standard accuracy, the first data modification result is considered to be a normal result. It should be noted that when all the results in the first data modification result are normal, the first data modification result is considered to be a normal result. Other components may refer to other application components in each application component except the target component, and these application components need to perform the second data modification. The second data modification script may refer to the component data modification script of other components.
[0054] For example, when the server determines that the first data modification result of the target component is a normal result, it indicates that the data modification tool or data modification process is being performed normally. At this time, the second data modification can be performed on the remaining other application components, that is, the server obtains the component data modification scripts of other application components in the data modification list to perform the second data modification.
[0055] Step S210: modify component data of other components based on the second data modification script to obtain second data modification results of other components.
[0056] Among them, the second data modification result may refer to the result obtained after data modification of other components, and the content included is the same as the first data modification result, which will not be repeated here.
[0057] For example, after the server obtains the component data modification script of other components, it can modify the data of other components according to the component data modification script, specifically, it can run the execution statement contained in the component data modification script to modify the data of other components, thereby obtaining the data modification result of other components.
[0058] Step S212: Aggregate the first data modification result and the second data modification result to obtain a component data modification result.
[0059] The component data modification result may refer to a result obtained by summarizing the first data modification result and the second data modification result, and may be used as the data modification result of the application system.
[0060] Exemplarily, after obtaining the data modification of other components, the server may aggregate the data modification result of the target component and the data modification results of other components to obtain a final component data modification result.
[0061] In this embodiment, when the server receives the component data modification instruction for multiple application components, it first obtains the component data modification list including the component data modification script of each application component, and then performs the subsequent data modification for each application component based on the component data modification list. Further, considering that if the data of all application components are modified at one time, all data modification results may be wrong due to certain influencing factors. Therefore, in this embodiment, based on the component data modification requirements, the first data modification script of the target component is first obtained in the data modification list, and the target component is any one or more components in each application component. Therefore, based on the first data modification script, a round of component data modification is first performed on the target component to obtain the first data modification result. When it is confirmed that the first data modification result is a normal result, it means that the data modification is carried out normally. At this time, based on the second data modification script of other components except the target component in the data modification list, the component data of other components is modified to obtain the second data modification results of other components. Finally, the first data modification result and the second data modification result are summarized to obtain the final component data modification result. Thus, on the one hand, this embodiment collects the data modification scripts of various application components into a data modification list to achieve uniformity of data modification, eliminating the need to develop corresponding data modification codes for each application component, thereby effectively improving the efficiency of data modification. On the other hand, the segmented data modification method is adopted to ensure the accuracy of data modification.
[0062] In an exemplary embodiment, as shown in FIG4 , in response to component data modification instructions for multiple application components, obtaining a component data modification list includes:
[0063] Step S402, in response to the component data modification instructions for multiple application components, performing association analysis between the application components to obtain the association analysis results between the application components.
[0064] Among them, the correlation analysis result can be used to characterize whether there is a coupling relationship or a dependency relationship between the application components.
[0065] Exemplarily, when receiving component modification instructions for multiple application components, the server may first analyze the association relationship between the application components, that is, analyze whether there is a coupling relationship or a dependency relationship between the application components.
[0066] In one example, the relationship between application components can be analyzed from the functions of the application components. For example, if the application functions implemented by the application components are interrelated, it can be considered that there is a relationship between the application components. If the application functions implemented by the application components are independent of each other, it can be considered that there is no relationship between the application components. Of course, in actual applications, the relationship between application components can also be analyzed based on other indicators or from other perspectives, which is not limited in this embodiment.
[0067] Step S404: When the correlation analysis result indicates that there is no correlation relationship between the application components, the component data modification scripts are summarized to obtain a component data modification list.
[0068] Exemplarily, when the correlation analysis result indicates that there is no correlation relationship between the application components, it means that the application components are independent of each other. At this time, the data modification scripts of the components can be summarized to obtain a component data modification list.
[0069] In one example, when the correlation analysis result indicates that there is a correlation relationship between the application components, the component data modification scripts of the application components can be stored in multiple component data modification lists, and the data modification operation of each component data modification list can be executed in sequence.
[0070] In this embodiment, it is considered that if the component data modification scripts of application components with associated relationships are aggregated and then data is modified, the component data modification scripts may affect each other, thereby affecting the final component data modification result. Therefore, in this embodiment, the component data modification scripts of application components without associated relationships are aggregated into a component data modification list to ensure the accuracy of the component data modification result.
[0071] In an exemplary embodiment, the server further executes: obtaining an initial data modification list; the initial data modification list includes a data modification directory for each application component.
[0072] The initial data modification list may refer to the initial data modification list, which only records the data modification directory of each application component and does not include the component data modification script. The data modification directory is used to store the component data modification script.
[0073] For example, since the data modification list can store component data modification scripts of different application components, in order to further improve the accuracy and standardization of data modification, in this embodiment, the server can first obtain an initial data modification list, which records the data modification directory of each application component, so as to facilitate the subsequent accurate and standardized summary of the data modification scripts of each component.
[0074] In an exemplary embodiment, as shown in FIG5 , each component data modification script is summarized to obtain a component data modification list, including:
[0075] Step S502: In each data modification directory, determine the target modification directory that matches each component data modification script.
[0076] Step S504, when all component data modification scripts are added to the matching target modification directory, a component data modification list is obtained.
[0077] The target modification directory may refer to a data modification directory corresponding to a component data modification script, or in other words, a data modification directory corresponding to an application component. The component data modification script of each application component needs to be stored in the corresponding data modification directory.
[0078] Exemplarily, after obtaining the initial data modification list, the server can filter out the target modification directory that matches each component data modification script from each data modification directory in the initial data modification list, thereby adding the component data modification script to the corresponding target modification directory. When all component data modification scripts are added to the corresponding target modification directory, a component data modification list is obtained.
[0079] In this embodiment, the component data modification list is obtained by adding the component data modification scripts of different application components to the corresponding target modification targets, making the component data modification list more standardized and clear, thereby improving the accuracy and standardization of data modification.
[0080] In an exemplary embodiment, as shown in FIG6 , based on the component data modification requirement indicated by the component data modification instruction, obtaining a first data modification script of a target component in a data modification list includes:
[0081] Step S602: based on the component data modification requirement indicated by the component data modification instruction, determine the target component quantity matching the component data modification requirement.
[0082] The target component quantity may refer to the quantity of application components that modify the first segment of data.
[0083] Exemplarily, the server obtains the component data modification requirement carried by the component data modification instruction, thereby determining the number of application components that are to be matched with the component data modification requirement for the first segment data modification. For example, when the component data modification requirement is a high data modification rate, a larger number of target components can be set to modify the first segment data. When a high data modification rate is not required, a small number of target components can be set, and can even be set to 1.
[0084] Step S604: Filter out target components that match the target component quantity from among the application components.
[0085] Exemplarily, after the server determines the target number of components, it can filter out target components that match the target number of components from various application components. The selection can be random or the application components can be specified by the developer.
[0086] Step S606: Obtain the first data modification script of the target component in the data modification list.
[0087] Exemplarily, after the server screens out the target components that match the number of target components, it can obtain the first data modification script of the target components in the data modification list.
[0088] In this embodiment, by determining the number of components that match the component data modification requirements, the target components for modifying the first segment of data are screened, thereby improving the accuracy and reliability of the modification of the first segment of data, laying the foundation for modifying the second segment of data, and thus improving the accuracy and reliability of the entire data modification process.
[0089] In an exemplary embodiment, as shown in FIG7 , modifying component data of a target component based on a first data modification script includes:
[0090] Step S702: Obtain script information of a first data modification script.
[0091] The script information may refer to the basic information of the first data modification script, such as the cluster number, the script name, the corresponding component name, etc.
[0092] Exemplarily, before modifying the first segment of data, the server may first obtain basic information of the first data modification script, such as the cluster number, script name, and corresponding component name, for subsequent matching, thereby ensuring the accuracy of the first data modification script.
[0093] Step S704, matching the script information with the list information of the data modification list to obtain an information matching result.
[0094] The list information may refer to the basic information of the data modification list, including but not limited to the component name, script name, cluster number, etc. The information matching result may refer to the matching degree between the script information and the data modification list, which may include a match passed or a match failed.
[0095] Exemplarily, after the server obtains the script information of the first data modification script, it can match the script information with the list information of the data modification list. If the script information is consistent with the list information, the match is considered to be successful; if the script information is inconsistent with the list information, the match is considered to be unsuccessful.
[0096] Step S706: When the information matching result indicates that the match is successful, the component data of the target component is modified.
[0097] Exemplarily, when the information matching result indicates that the match is successful, the first segment of data of the target component may be modified.
[0098] It should be noted that other components also need to perform information matching before modifying the second segment of data. The matching process is consistent with the matching process of the target component and will not be repeated here.
[0099] In this embodiment, the accuracy of the target component is ensured by matching the script information with the list information of the data modification list, thereby improving the accuracy of the first segment of data modification and further improving the accuracy of the entire data modification.
[0100] In an exemplary embodiment, as shown in FIG8 , the server further executes:
[0101] Step S802: if a data modification instruction for each application component is received, the data modification status of each application component is obtained respectively.
[0102] Step S804: When the data modification status indicates that the data modification is not completed, re-confirm the data modification for the application component.
[0103] The data modification instruction may refer to an instruction to modify the data of each application component again. The data modification state may refer to the state of the application component performing data modification, which may include whether the data modification is completed or not completed.
[0104] Exemplarily, when the server receives a second data modification instruction for each application component, it needs to obtain the data modification status of each application component, that is, to determine whether each application component has completed the current data modification operation. If not, at this time, for the second data modification instruction, the server will perform a second data modification confirmation, that is, display the current unfinished application component on the front-end interface and ask whether to continue. If a continue instruction is received, the data modification record of the current unfinished application component will be overwritten, and the data modification operation of the second data modification instruction will be performed on it. If a non-continue instruction is received, the data modification operation of the second data modification instruction will not be performed on the application component.
[0105] In this embodiment, secondary confirmation is performed to confirm whether a new data modification operation is executed when the application component has not finished modifying the current data, thereby improving the accuracy of data modification.
[0106] In a specific embodiment, as shown in FIG9 , the process of data modification includes:
[0107] S1: In response to component data modification instructions for multiple application components, perform association analysis between the application components to obtain association analysis results between the application components. When the association analysis results indicate that there is no association between the application components, obtain an initial List file, which includes a data modification directory for each application component. Add the SQL script for data modification of each application component to the corresponding data modification directory to obtain a final List file.
[0108] S2: Based on the component data modification requirements, determine the number of target components that match the component data modification requirements. In each application component, filter out the target components that match the target component number. In the List file, obtain the script information of the first SQL script of the target component, match the script information with the list information of the data modification list, and obtain the information matching result. If the information matching result indicates that the match is passed, modify the first segment of data of the target component to obtain the first data modification result of the target component.
[0109] S3: When the first data modification result is a normal result, obtain the second SQL script of other components in each application component except the target component in the List file, perform the second segment component data modification on other components based on the second SQL script, and obtain the second data modification result of other components.
[0110] S4: Summarize the first data modification result and the second data modification result to obtain the component data modification result. If a second data modification instruction is received for each application component, obtain the data modification status of each application component respectively. If the data modification status indicates that the data modification is not completed, confirm the data modification again for the application component.
[0111] In this embodiment, when the server receives a component data modification instruction for multiple application components, it first obtains a List file including the SQL scripts for data modification of each application component, and then performs subsequent data modification for each application component based on the List file. Further, considering that if data modification is performed on all application components at one time, all data modification results may be wrong due to certain influencing factors. Therefore, in this embodiment, based on the component data modification requirements, the first SQL script of the target component is first obtained in the List file, and the target component is any one or more components in each application component. Therefore, based on the first SQL script, a round of component data modification is first performed on the target component to obtain the first data modification result. When it is confirmed that the first data modification result is a normal result, it means that the data modification is performed normally. At this time, based on the second SQL script of other components except the target component in the List file, component data modification is performed on other components to obtain the second data modification results of other components. Finally, the first data modification result and the second data modification result are summarized to obtain the final component data modification result. Thus, on the one hand, this embodiment collects the SQL scripts of various application components into a List file to achieve uniformity of data modification, eliminating the need to develop corresponding data modification codes for each application component, thereby effectively improving the efficiency of data modification. On the other hand, the segmented data modification method is adopted to ensure the accuracy of data modification.
[0112] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0113] Based on the same inventive concept, the embodiment of the present application also provides a data modification device for implementing the data modification method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more data modification device embodiments provided below can refer to the limitations on the data modification method above, and will not be repeated here.
[0114] In an exemplary embodiment, as shown in FIG. 10 , a data modification device is provided, including: a list acquisition module 1002, for acquiring a component data modification list in response to component data modification instructions for multiple application components; the component data modification list includes a component data modification script for each application component; a first script acquisition module 1004, for acquiring a first data modification script of a target component in the data modification list based on the component data modification requirement indicated by the component data modification instruction; the target component is any one or more components in each application component; a first data modification module 1006, for performing component data modification on the target component based on the first data modification script to obtain a first data modification result of the target component; a second script acquisition module 1008, for acquiring a second data modification script of other components in each application component except the target component in the data modification list when the first data modification result is a normal result; a second data modification module 1010, for performing component data modification on other components based on the second data modification script to obtain a second data modification result of other components; a data aggregation module 1012, for aggregating the first data modification result and the second data modification result to obtain a component data modification result.
[0115] In one of the embodiments, the list acquisition module 1002 also includes: a correlation analysis unit, which is used to respond to component data modification instructions for multiple application components, analyze the correlation relationship between the application components, and obtain the correlation analysis results between the application components; a summary unit, which is used to summarize the component data modification scripts to obtain a component data modification list when the correlation analysis results indicate that there is no correlation relationship between the application components.
[0116] In one of the embodiments, the device is also used to: obtain an initial data modification list; the initial data modification list includes a data modification directory for each application component; the summary unit is also used to: in each data modification directory, determine a target modification directory that matches each component data modification script; when each component data modification script is added to the matching target modification directory, a component data modification list is obtained.
[0117] In one of the embodiments, the first script acquisition module 1004 is further used to: determine the number of target components that match the component data modification requirements based on the component data modification requirements indicated by the component data modification instruction; screen out target components that match the target component number in each application component; and obtain the first data modification script of the target component in the data modification list.
[0118] In one of the embodiments, the first data modification module 1006 is further used to: obtain script information of the first data modification script; match the script information with the list information of the data modification list to obtain an information matching result; and modify component data of the target component when the information matching result indicates that the match passes.
[0119] In one of the embodiments, the device is also used to: if a data modification instruction for each application component is received, obtain the data modification status of each application component respectively; when the data modification status indicates that the data modification is not completed, confirm the data modification again for the application component.
[0120] Each module in the above data modification device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0121] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG11. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data modification data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a data modification method is implemented.
[0122] Those skilled in the art will understand that the structure shown in FIG. 11 is merely a block diagram of a partial 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 shown in the figure, or combine certain components, or have a different arrangement of components.
[0123] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: in response to component data modification instructions for multiple application components, a component data modification list is obtained; the component data modification list includes a component data modification script for each application component; based on the component data modification requirements indicated by the component data modification instructions, a first data modification script for a target component is obtained in the data modification list; the target component is any one or more components in each application component; based on the first data modification script, component data of the target component is modified to obtain a first data modification result of the target component; when the first data modification result is a normal result, a second data modification script for other components in each application component except the target component is obtained in the data modification list; based on the second data modification script, component data of other components are modified to obtain second data modification results of other components; the first data modification result and the second data modification result are summarized to obtain a component data modification result.
[0124] In one embodiment, when the processor executes the computer program, the following steps are also implemented: in response to component data modification instructions for multiple application components, an association relationship analysis is performed between the application components to obtain an association analysis result between the application components; when the association analysis result indicates that there is no association relationship between the application components, the component data modification scripts are summarized to obtain a component data modification list.
[0125] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining an initial data modification list; the initial data modification list includes a data modification directory for each application component; summarizing the data modification scripts of each component to obtain a component data modification list, including: in each data modification directory, determining a target modification directory that matches each component data modification script; when each component data modification script is added to the matching target modification directory, a component data modification list is obtained.
[0126] In one embodiment, when the processor executes the computer program, the following steps are also implemented: based on the component data modification requirements indicated by the component data modification instruction, determining the number of target components that match the component data modification requirements; in each application component, screening out the target components that match the target component number; in the data modification list, obtaining the first data modification script of the target component.
[0127] In one embodiment, when the processor executes the computer program, it also implements the following steps: obtaining script information of a first data modification script; matching the script information with the list information of a data modification list to obtain an information matching result; and when the information matching result indicates that the match passes, performing component data modification on the target component.
[0128] In one embodiment, the processor also implements the following steps when executing the computer program: if a data modification instruction for each application component is received, the data modification status of each application component is obtained respectively; when the data modification status indicates that the data modification is not completed, the data modification confirmation is performed again for the application component.
[0129] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: in response to component data modification instructions for multiple application components, a component data modification list is obtained; the component data modification list includes a component data modification script for each application component; based on the component data modification requirements indicated by the component data modification instructions, a first data modification script for the target component is obtained in the data modification list; the target component is any one or more components in each application component; based on the first data modification script, the component data of the target component is modified to obtain a first data modification result of the target component; when the first data modification result is a normal result, in the data modification list, a second data modification script for other components in each application component except the target component is obtained; based on the second data modification script, the component data of other components is modified to obtain a second data modification result of other components; the first data modification result and the second data modification result are summarized to obtain a component data modification result.
[0130] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: in response to component data modification instructions for multiple application components, an association relationship analysis is performed between the application components to obtain an association analysis result between the application components; when the association analysis result indicates that there is no association relationship between the application components, the component data modification scripts are summarized to obtain a component data modification list.
[0131] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining an initial data modification list; the initial data modification list includes a data modification directory for each application component; summarizing the data modification scripts of each component to obtain a component data modification list, including: in each data modification directory, determining a target modification directory that matches each component data modification script; when each component data modification script is added to the matching target modification directory, a component data modification list is obtained.
[0132] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the component data modification requirements indicated by the component data modification instruction, determining the number of target components that match the component data modification requirements; in each application component, screening out the target components that match the target component number; in the data modification list, obtaining the first data modification script of the target component.
[0133] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: obtaining script information of a first data modification script; matching the script information with the list information of a data modification list to obtain an information matching result; and when the information matching result indicates that the match is successful, performing component data modification on the target component.
[0134] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if a data modification instruction for each application component is received, the data modification status of each application component is obtained respectively; when the data modification status indicates that the data modification is not completed, the data modification confirmation is performed again for the application component.
[0135] In one embodiment, a computer program product is provided, including a computer program, which implements the following steps when executed by a processor: in response to component data modification instructions for multiple application components, a component data modification list is obtained; the component data modification list includes a component data modification script for each application component; based on the component data modification requirements indicated by the component data modification instructions, a first data modification script for a target component is obtained in the data modification list; the target component is any one or more components in each application component; based on the first data modification script, component data of the target component is modified to obtain a first data modification result of the target component; when the first data modification result is a normal result, a second data modification script for other components in each application component except the target component is obtained in the data modification list; based on the second data modification script, component data of other components are modified to obtain second data modification results of other components; the first data modification result and the second data modification result are summarized to obtain a component data modification result.
[0136] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: in response to component data modification instructions for multiple application components, an association relationship analysis is performed between the application components to obtain an association analysis result between the application components; when the association analysis result indicates that there is no association relationship between the application components, the component data modification scripts are summarized to obtain a component data modification list.
[0137] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining an initial data modification list; the initial data modification list includes a data modification directory for each application component; summarizing the data modification scripts of each component to obtain a component data modification list, including: in each data modification directory, determining a target modification directory that matches each component data modification script; when each component data modification script is added to the matching target modification directory, a component data modification list is obtained.
[0138] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the component data modification requirements indicated by the component data modification instruction, determining the number of target components that match the component data modification requirements; in each application component, screening out the target components that match the target component number; in the data modification list, obtaining the first data modification script of the target component.
[0139] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: obtaining script information of a first data modification script; matching the script information with the list information of a data modification list to obtain an information matching result; and when the information matching result indicates that the match is successful, performing component data modification on the target component.
[0140] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if a data modification instruction for each application component is received, the data modification status of each application component is obtained respectively; when the data modification status indicates that the data modification is not completed, the data modification confirmation is performed again for the application component.
[0141] 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 computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0142] 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 application.
[0143] 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 variations 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.
Claims
1. A data modification method, characterized in that: The method comprises: In response to component data modification instructions for multiple application components, a component data modification list is obtained; the component data modification list includes a component data modification script for each of the application components; Based on the component data modification requirement indicated by the component data modification instruction, obtaining a first data modification script of a target component in the data modification list; the target component is any one or more components in each of the application components; Based on the first data modification script, modify the component data of the target component to obtain a first data modification result of the target component; When the first data modification result is a normal result, obtaining, in the data modification list, second data modification scripts of other components in each of the application components except the target component; Based on the second data modification script, modify the component data of the other components to obtain a second data modification result of the other components; The first data modification result and the second data modification result are aggregated to obtain a component data modification result.
2. The method according to claim 1, characterized in that The step of obtaining a component data modification list in response to component data modification instructions for multiple application components includes: In response to component data modification instructions for multiple application components, performing association analysis between the application components to obtain association analysis results between the application components; When the correlation analysis result indicates that there is no correlation relationship between the application components, the component data modification scripts are summarized to obtain a component data modification list.
3. The method according to claim 2, characterized in that The method further comprises: Obtaining an initial data modification list; the initial data modification list includes a data modification directory for each of the application components; The component data modification scripts are aggregated to obtain a component data modification list, including: In each of the data modification directories, respectively determining a target modification directory that matches each of the component data modification scripts; When all the component data modification scripts are added to the matching target modification directory, a component data modification list is obtained.
4. The method according to claim 1, characterized in that The step of obtaining a first data modification script of a target component in the data modification list based on the component data modification requirement indicated by the component data modification instruction includes: Based on the component data modification requirement indicated by the component data modification instruction, determining the number of target components that match the component data modification requirement; Filtering out target components that match the number of target components from among the application components; In the data modification list, a first data modification script of the target component is obtained.
5. The method according to claim 1, characterized in that The modifying component data of the target component based on the first data modification script includes: Obtaining script information of the first data modification script; Matching the script information with the list information of the data modification list to obtain an information matching result; When the information matching result indicates that the match is successful, the component data of the target component is modified.
6. The method according to claim 1, characterized in that The method further comprises: If a data modification instruction for each of the application components is received, the data modification status of each of the application components is obtained respectively; When the data modification status indicates that the data modification is not completed, the data modification confirmation is performed again for the application component.
7. A data modification device, characterized in that: The device comprises: A list acquisition module, used for acquiring a component data modification list in response to component data modification instructions for multiple application components; the component data modification list includes a component data modification script for each of the application components; A first script acquisition module, configured to acquire a first data modification script of a target component in the data modification list based on the component data modification requirement indicated by the component data modification instruction; the target component is any one or more components in each of the application components; A first data modification module, configured to modify component data of the target component based on the first data modification script to obtain a first data modification result of the target component; A second script acquisition module is used for acquiring, in the data modification list, second data modification scripts of other components in each of the application components except the target component when the first data modification result is a normal result; A second data modification module, configured to modify component data of the other components based on the second data modification script to obtain a second data modification result of the other components; The data aggregation module is used to aggregate the first data modification result and the second data modification result to obtain a component data modification result.
8. The device according to claim 7, characterized in that The list acquisition module further includes: A correlation analysis unit, configured to analyze the correlation relationship between the application components in response to the component data modification instruction for the multiple application components, and obtain the correlation analysis result between the application components; The summarizing unit is used to summarize the component data modification scripts to obtain a component data modification list when the correlation analysis result indicates that there is no correlation relationship between the application components.
9. The device according to claim 8, characterized in that The device is also used to: obtain an initial data modification list; the initial data modification list includes a data modification directory of each application component; The summarizing unit is also used to: determine, in each of the data modification directories, a target modification directory that matches each of the component data modification scripts; and obtain a component data modification list when each of the component data modification scripts is added to the matching target modification directory.
10. The device according to claim 7, characterized in that The first script acquisition module is also used to: determine the number of target components that match the component data modification requirements based on the component data modification requirements indicated by the component data modification instruction; screen out target components that match the number of target components in each of the application components; and obtain the first data modification script of the target component in the data modification list.
11. The device according to claim 7, characterized in that The first data modification module is also used to: obtain script information of the first data modification script; match the script information with the list information of the data modification list to obtain an information matching result; and modify component data of the target component when the information matching result indicates a successful match.
12. The device according to claim 7, characterized in that The device is also used for: if receiving a data modification instruction for each application component, respectively obtaining the data modification status of each application component; when the data modification status indicates that the data modification is not completed, performing data modification confirmation again for the application component.
13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.