Database system changing method, electronic device, and program product
Through the association between the client and the code base, the change code is automatically deployed to the database server, solving the stability problems caused by manual deployment of the change code, and realizing automated changes and rapid iteration of the database system.
Patent Information
- Application Number
- CN202510192741.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2025-05-16
AI Technical Summary
In the prior art, manually publishing the change code to the server of the financial system, the stability caused by frequent changes is greatly affected and the stability of the system is easily affected.
By associating the client with the code base, responding to the change operation of the database system, obtaining the change code from the code base, connecting to the database server, deploying the change code to the database server, and making system changes based on the deployed change code.
It realizes automated changes to the database system, reduces the impact of changes on the stability of the database system, and can quickly iterate changes to enable the database system to meet business changes needs.
Smart Images

Figure CN120010904A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to Internet technology and database development technology, and in particular to a method for changing a database system, an electronic device, and a program product. Background Art
[0002] Currently, the development of Internet business, daily policy updates, and frequent changes in business requirements will lead to changes in the database system used to support the business, such as the continuous iterative changes in the financial system. The financial system requires system stability, and system failures will have a significant impact on the business. Therefore, the impact of frequent changes on stability is the primary issue that needs to be addressed in the financial system change process.
[0003] In the related art, the change code is manually released to the server of the financial system to complete the change to the financial system. The risk of manually executing the change to the financial system is relatively high and it is easy to affect the stability of the system. Summary of the invention
[0004] The embodiments of the present disclosure provide a method for changing a database system, an electronic device, and a program product to solve the above technical problems to a certain extent.
[0005] In one aspect of an embodiment of the present disclosure, a method for changing a database system is provided. The method is used for a client, the client is associated with a code library, and the code library is used to manage different code versions of the database system. The method includes:
[0006] In response to a change operation on the database system, obtaining a change code for changing the database system from the code library;
[0007] Connecting to a database server corresponding to the database system, deploying the change code to the database server, and the database system runs based on the database server;
[0008] Make system changes to the database system based on the deployed change code.
[0009] In an exemplary embodiment, the acquiring, from the code library, a change code for changing the database system includes:
[0010] Sending a changed code extraction command to the code repository, so that the code repository extracts the changed code from a code branch indicated by the changed code extraction command, where the code branch is a development branch created when developing the changed code;
[0011] The changed code extracted from the code library is obtained from the code library.
[0012] In an exemplary embodiment, the code library is used to compare the current code version stored in the database system with the unsubmitted code version in the code branch that has not been submitted to the code library to obtain the changed code, where the changed code is the code in the unsubmitted code version that is different from the current code version.
[0013] In an exemplary embodiment, connecting to a database server corresponding to the database system and deploying the changed code to the database server includes:
[0014] Performing encoding conversion on the change code to obtain a conversion code, wherein the encoding type of the conversion code matches the encoding type used by the database system;
[0015] Connecting to the database server and deploying the conversion code to the database server;
[0016] The deployment-based change code makes system changes to the database system, including:
[0017] The conversion code is executed to make system changes to the database system.
[0018] In an exemplary embodiment, after executing the conversion code, the method further includes:
[0019] Detect the code running status and obtain the code execution results;
[0020] In the case where the code execution result indicates that the code execution is invalid, execution invalidation information and a package name of an invalid package are displayed, where the invalid package is the package to which the conversion code whose execution is invalid belongs.
[0021] In an exemplary embodiment, detecting the code running state and obtaining the code execution result includes:
[0022] Determining, based on the code name of the changed code, a package identifier of a package to which the converted code belongs when it is run in the database system;
[0023] Based on the program package identifier, querying the running status of the program package in a data dictionary view corresponding to the database system, wherein the data dictionary view includes status and attribute information of all objects in the database system;
[0024] In response to the running status indicating that the program package running fails, determining the code execution result as code execution failure.
[0025] In an exemplary embodiment, after detecting the code running status and obtaining the code execution result, the method further includes:
[0026] Based on the code execution result, a construction record of the changed code is generated, and the construction record is stored in a construction record log.
[0027] In an exemplary embodiment, it is characterized in that the code base is a Git repository;
[0028] Before obtaining, in response to the change operation on the database system, the change code for changing the database system from the code library, the method further includes:
[0029] The repository address of the Git repository is associated with the client so that the client obtains the changed code from the Git repository based on the repository address.
[0030] In an exemplary embodiment, the client includes a client container, the client container is used to perform a change operation on the database system, the client container is generated based on a client image, and the client image is associated with the code library.
[0031] Another aspect of this embodiment provides a database system change device, the device is used for a client, the client is associated with a code library, the code library is used to manage different code versions of the database system, the device includes:
[0032] A code acquisition module, configured to acquire, in response to a change operation on a database system, a change code for changing the database system from the code library;
[0033] A code deployment module, used to connect to a database server corresponding to the database system and deploy the changed code to the database server, on which the database system runs;
[0034] The system change module is used to make system changes to the database system based on the deployed change code.
[0035] Another aspect of this embodiment provides an electronic device, including:
[0036] Memory for storing computer programs;
[0037] The processor is used to execute the computer program stored in the memory, and when the computer program is executed, the method for changing the database system described in any one of the above embodiments is implemented.
[0038] Another aspect of this embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for changing the database system described in any of the above embodiments is implemented.
[0039] Another aspect of this embodiment provides a computer program product, including a computer program, which, when executed by a processor, implements the method for changing the database system described in any of the above embodiments.
[0040] In the disclosed embodiment, the client is associated with a code base for managing different code versions of the database system. When the database system is changed, the change code for changing the database system can be obtained from the associated code base, and then the change code can be deployed to the database server by connecting to the database server corresponding to the database system. Based on the deployed change code, the change to the database system is realized. The automatic deployment of the change code is realized through the client, and the audit and standardization of the code are realized. By automatically deploying the change code, the automatic change of the database system can be realized. Compared with the method of manually directly deploying the change code to the database server, the automatic deployment of the change can reduce the impact of the change on the stability of the database system, and can realize the rapid iterative change of the database system, so that the database system meets the business change requirements.
[0041] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0043] The present disclosure may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:
[0044] Figure 1 A schematic diagram of a changed architecture of a database system provided by an exemplary embodiment of the present disclosure;
[0045] Figure 2 A flowchart of a method for changing a database system provided by an exemplary embodiment of the present disclosure;
[0046] Figure 3 A flowchart of a code development process provided for an exemplary embodiment of the present disclosure;
[0047] Figure 4 A schematic diagram of a configuration interface for a configuration-associated Git repository provided by an exemplary embodiment of the present disclosure;
[0048] Figure 5 A flowchart of a process for obtaining a change code provided by an exemplary embodiment of the present disclosure;
[0049] Figure 6 A flowchart of a code change automatic deployment process provided for an exemplary embodiment of the present disclosure;
[0050] Figure 7 A schematic diagram of recording a construction record log provided by an exemplary embodiment of the present disclosure;
[0051] Figure 8 A flowchart of a code development and deployment process for a change provided by an exemplary embodiment of the present disclosure;
[0052] Fig. 9 A schematic diagram of a configuration interface for associating a client image with an automation script provided by an exemplary embodiment of the present disclosure;
[0053] Fig.10 A schematic diagram of the structure of a database system change device provided by an exemplary embodiment of the present disclosure;
[0054] Fig.11 A schematic structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0055] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.
[0056] Those skilled in the art can understand that the terms "first" and "second" in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate the necessary logical order between them.
[0057] It should also be understood that in the embodiments of the present disclosure, “plurality” may refer to two or more than two, and “at least one” may refer to one, two, or more than two.
[0058] It should also be understood that any component, data or structure mentioned in the embodiments of the present disclosure can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.
[0059] In addition, the term "and / or" in the present disclosure is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present disclosure generally indicates that the associated objects before and after are in an "or" relationship.
[0060] It should also be understood that the description of the various embodiments in the present disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.
[0061] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0062] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.
[0063] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.
[0064] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0065] The disclosed embodiments can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, servers, etc. include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, etc.
[0066] Electronic devices such as terminal devices, computer systems, servers, etc. can be described in the general context of computer system executable instructions (such as program modules) executed by computer systems. Generally, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in a distributed cloud computing environment, where tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.
[0067] In an embodiment of the present disclosure, a client is provided for automatically deploying source code (i.e., change code) for changing the business functions of a database system to a database server corresponding to the database system, so that the database server runs based on the changed program to implement system changes to the database system.
[0068] like Figure 1As shown, it shows a schematic diagram of the architecture of the database system provided by an exemplary embodiment of the present disclosure, which includes a client 110 , a database server 120 and a code library 130 .
[0069] The client 110 is used to automatically deploy the change code developed by the developer to change the database system to the database server, thereby realizing the automatic deployment of the change code. Optionally, the client 110 can be run on the above-mentioned electronic device. Specifically, the client 110 is used to complete the build process of the change code. Build refers to the process of converting source code into an executable or deployable program. Build includes a series of processes such as code execution compilation, packaging, code conversion, and deployment.
[0070] The database server 120 is a server for supporting the operation of a database system. Optionally, the database system may be an EBS (Enterprise Business Suite) financial system.
[0071] The code library 130 is used to manage different code versions of the database system, wherein the code version stored in the code library 130 is synchronized with the code version currently running in the database system to implement the management of different versions of the database system code.
[0072] Among them, in a possible implementation manner, when there is a need to change the database system, the developer develops the change code and stores the change code in the code library 130. The client 110 can obtain the change code from the code library 130 and connect to the database server 120 corresponding to the database system, thereby deploying the change code to the database system to achieve automatic deployment of the change code.
[0073] like Figure 2 As shown, it shows a flowchart of a method for changing a database system provided by an exemplary embodiment of the present disclosure. The method provided by the embodiment of the present disclosure can be used for the above-mentioned client 110, such as Figure 2 As shown, the following steps 201-203 are included:
[0074] Step 201 , in response to a change operation on a database system, obtain a change code for changing the database system from a code library.
[0075] The client is provided with a change option for triggering a change in the database system. The user can trigger the change option to enable the client to start the automatic deployment (i.e., building) process of the change code. In an illustrative manner, the change option can be a code building option. When the triggering operation on the code building option is received, it is determined that the change operation on the database system is received.
[0076] In a possible implementation, after receiving the change operation on the database system, a code library associated with the client may be obtained, and the change code for changing the database system may be obtained from the associated code library.
[0077] Change code refers to the source code used to implement business change requirements of the database system. For example, it is the source code used to implement different business function change requirements such as adding new functions, function upgrades, and function repairs in the database system. After the developer develops the change code according to the business requirements, the change code can be stored in the associated code library so that the client can obtain the change code from the code library. After the change code is deployed to the database server and executed, the database system can implement the business function corresponding to the change code.
[0078] Step 202, connecting to a database server corresponding to the database system, deploying the changed code to the database server, and the database system running based on the database server.
[0079] After obtaining the change code, you need to connect to the database server corresponding to the database system to upload and deploy the change code to the database server.
[0080] Optionally, the database server may include at least one server. When one server is included, the client is connected to the server, and the change code is uploaded and deployed. When two or more servers are included, the target server to be deployed can be determined according to the change code, the client is connected to the target server in the database server, and the change code is deployed to the target server.
[0081] In a possible implementation, the target server can be determined based on the storage path of the change code. When the database server includes multiple servers, different root directories can be established for different servers in the code library, and the codes corresponding to different servers can be stored in the corresponding root directories. After obtaining the change code, the target server can be determined based on the root directory to which the storage path of the change code belongs. The target server is the server corresponding to the root directory to which the storage path of the change code belongs.
[0082] Step 203: Perform system changes on the database system based on the deployed change code.
[0083] After the change code is deployed to the database server, the database system can be changed based on the deployed change code. System change refers to the change of the business functions that can be realized by the database system. After the database system is changed based on the deployed change code, the database system can realize the business functions corresponding to the change code.
[0084] In a possible implementation, after the change code is deployed to the database server, the client may send a code execution command to the database server to cause the database server to run the deployed change code to implement system changes to the database system.
[0085] In another possible implementation, after the change code is deployed to the database server, the database server may automatically execute the change code to make system changes to the database system.
[0086] In the disclosed embodiment, the client is associated with a code base for managing different code versions of the database system. When the database system is changed, the change code for changing the database system can be obtained from the associated code base, and then the change code can be deployed to the database server by connecting to the database server corresponding to the database system. Based on the deployed change code, the change to the database system is realized. The automatic deployment of the change code is realized through the client, and the audit and standardization of the code are realized. By automatically deploying the change code, the automatic change of the database system can be realized. Compared with the method of manually directly deploying the change code to the database server, the automatic deployment of the change can reduce the impact of the change on the stability of the database system, and can realize the rapid iterative change of the database system, so that the database system meets the business change requirements.
[0087] Optionally, the code base can be a Git repository. Git is a distributed version control system that can be used to manage different code versions. Among them, the Git repository can be divided into a remote code base and a local code base. The remote code base is a code base deployed on a remote server, and the local code base is a code base deployed on a device used by developers. Among them, the code base of the embodiment of the present disclosure can be a Git remote code base.
[0088] Before code development, the current code version of the database system is synchronized to the Git remote code library. Optionally, the program package of the database system is uploaded to the Git repository to synchronize the current code version of the database system to the Git repository, specifically, the program package of the database system is uploaded to the Git remote code library.
[0089] Before performing a change operation on the database system through the client, the client needs to be associated with the address of the code library so that the client can obtain the change code from the code based on the address of the code library. In a possible implementation, the warehouse address of the Git warehouse is associated with the client so that the client can obtain the change code from the Git warehouse based on the warehouse address.
[0090] In the disclosed embodiment, developers can develop code based on Git to obtain changed code. Figure 3As shown, it shows a schematic diagram of the process of developers developing codes based on Git, wherein, when developers develop code changes based on Git, they can first copy the code (including the package to be changed) from the remote code library to the local code library, obtain the code from the local code library to develop the code on the local workspace, and then store the developed code in the temporary storage area. After all the development codes are stored in the temporary storage area, they can be submitted to the local code library, and then the newly developed code in the local code library can be uploaded to the remote code library.
[0091] In one possible implementation, code changes are developed through code branches. Branches allow developers to work outside the mainline, thus avoiding the impact on the mainline code. The mainline code is the code version currently running in the database system. When a new function is needed or part of the code needs to be repaired, a code branch can be created and developed on the code branch. After testing and debugging, it can be merged into the mainline to complete the change to the mainline code. Optionally, the code branch can be a Git branch.
[0092] Furthermore, the Git repository address and the branch name used to develop the changed code can be associated with the client, so that the client can obtain the changed code based on the repository address and branch name. Figure 4 As shown, a Git address configuration item 41 and a branch name configuration item 42 may be provided in the client interface, so that the user can configure the Git address and the branch name in the client interface to associate them with the client.
[0093] When the client obtains the changed code from the code library, the code library first obtains the changed code from the code branch and then provides it to the client. Figure 5 As shown, the process of obtaining the change code for changing the database system from the code base includes steps 301-302:
[0094] Step 301: Send a changed code extraction command to a code repository so that the code repository extracts the changed code from a code branch indicated by the changed code extraction command.
[0095] The code branch is a development branch created when developing a code change. Optionally, the code branch is the Git branch mentioned above. When the client obtains the changed code from the code repository, it first sends a changed code extraction command to the code repository so that the code repository can obtain the changed code.
[0096] The code library extracts the change code from the code branch according to the code branch indicated in the change code extraction command. Specifically, the code library is used to compare the current code version of the stored database system with the unsubmitted code version in the code branch that has not been submitted to the code library to obtain the change code, and the change code is the code in the unsubmitted code version that is different from the current code version. Since there may be multiple developers developing codes based on code branches in parallel, different developers develop different codes. In order to obtain the complete change code, the current code version of the code library is compared with the code version stored in each temporary storage area, wherein the code version stored in each temporary storage area is the unsubmitted version that has not been submitted to the code library. The current code version stored in the remote code library is compared with the code version stored in each temporary storage area to obtain the change code compared to the current code version, and the change code is extracted to the remote code library.
[0097] In a possible implementation, the code base may obtain the changed code through the Git diff command. For example, the command: git diff-tree-r --no-commit-id --name-only HEAD is used to enable the code base to obtain the changed code from the code branch.
[0098] Step 302: Obtain the changed code extracted from the code library from the code library.
[0099] After the code library obtains the changed code extracted by the code library based on the changed code extraction command, the changed code is stored in the code library, and the client can extract the changed code to deploy the changed code to the database server.
[0100] In the disclosed embodiment, when obtaining the change code for changing the database system, the variables of the code version used by the current database system are obtained, that is, the code sent to the change compared to the current code version is obtained, which helps to improve the efficiency of deploying the change code to the database server. And by creating a development branch for code development, the development of code changes can be completed without affecting the main line code of the database system.
[0101] In a possible implementation, before the change code is deployed to the database server, the change code needs to be converted to conform to the database system language environment. Figure 6 As shown, the process of connecting to a database server corresponding to the database system, deploying the change code to the database server, and making system changes to the database system based on the deployed change code includes steps 401-403:
[0102] Step 401, perform code conversion on the changed code to obtain a converted code.
[0103] Encoding conversion is used to convert the developed change code into a code that is compatible with the database character set, that is, the encoding type of the converted code matches the encoding type used by the database system. Before the change code is deployed to the database server, the change code is first encoded and converted. In one possible implementation, the iconv command can be used to perform encoding conversion. Illustratively, the command: iconv -f GBK -t UTF-8″$file″ -o″$file″.XXXX can be used to convert the encoding type of the change code from the GBK type to the encoding type UTF-8 used by the database system.
[0104] Step 402: Connect to a database server and deploy the converted code to the database server.
[0105] After conversion, the conversion code is deployed to the database server. Optionally, the corresponding target server can be determined according to the root directory to which the changed file belongs, the target server is connected, and the conversion code is deployed to the target server.
[0106] Step 403: execute the conversion code to make system changes to the database system.
[0107] Afterwards, the system change can be made to the database system based on the deployed change code, i.e., the conversion code. Optionally, the system change can be made to the database system by executing the conversion code.
[0108] Since the process of executing the conversion code is executed on the database server, in order to enable the client to know and record the code execution status, in the embodiment of the present disclosure, after executing the conversion code, the client also checks the status of the program package in the database server to check whether the change code is invalid. In a possible implementation, Figure 6 As shown, after executing the conversion code, the following steps 404-405 are also included:
[0109] Step 404, detecting the code running status and obtaining the code execution result.
[0110] In a possible implementation, the running state of the converted code, i.e., the code execution result, can be obtained by detecting the running state of the program package to which the code belongs. The code execution result includes code execution failure and code execution success. In one example, the process of detecting the running state of the code may include steps 4041-4043:
[0111] Step 4041: Based on the code name of the changed code, determine the package identifier of the package to which the converted code belongs when it is running in the database system.
[0112] The code name of the changed code can be the name in the code branch. The codes running in the database system are divided into different packages. The changed code is deployed to the target package of the database server. The package ID of the target package to which the changed code belongs after being deployed to the database server (i.e., the converted code) needs to be determined based on the code name of the changed code.
[0113] In a possible implementation, the package identifier in the embodiment of the present disclosure may be a partial string in the package name of the target package in the database server. The package name of the target package and the code name of the change code contain partially identical strings, and the string identical to the package name in the code name of the change code may be extracted and the identical string may be determined as the package identifier.
[0114] Illustratively, the code name of the changed code may be apps.cux_test_pkg.pck, wherein the character string identical to the actual package name may be cux_test_pkg, which is extracted from the code name of the changed code and determined as the package identifier of the target package.
[0115] In one example, the string in the code name of the changed code that is the same as the package name can be the longest string in the code name. In one example, a function get_longest_part can be defined to receive an input string p_string and return the longest part of the string from the input string. When searching for the longest part of the string, REGEXP_SUBSTR can be used to split the string by a period (.), extract and calculate the length of each part of the string, and then compare the string length of the current extracted part v_part with the longest part v_longest_part obtained. If the string length of the current extracted part is greater than the string length of the longest part obtained, v_longest_part is updated; after the extraction is completed, the longest string is output.
[0116] Step 4042: Based on the program package identifier, query the running status of the program package in the data dictionary view corresponding to the database system.
[0117] The data dictionary view includes the status and attribute information of all objects in the database system. That is, the data dictionary view includes the running status of the program package of the database system. Exemplarily, the data dictionary view can be dba objects, which is used to record the status and attribute information of all objects in the EBS system.
[0118] Based on the program package identifier obtained above, the running status of the corresponding target program package is queried in the data dictionary view.
[0119] In a possible implementation, the number of packages with invalid running status can be queried in the data dictionary view based on the above-mentioned package identifier. When the number of packages with invalid running status is 0, the running status of the package is determined to be successful. If the number of packages with invalid running status is not 0, it is determined that the target package has failed to run.
[0120] Indicatively, the select...into statement may be used to obtain the count of objects whose status is invalid (INVALID) and which match the longest string processed by the get_longest_part function described above from the data dictionary view dba_objects. If the count is not 0, a runtime error flag is returned.
[0121] Step 4043: In response to the running status indicating that the program package is running invalid, determining that the code execution result is code execution invalid.
[0122] When the running status of the program package indicates that the running of the program package is invalid, it is determined that the code execution result is code execution failure.
[0123] Step 405 , when the code execution result indicates that the code execution is invalid, the execution invalidation information and the package name of the invalid package are displayed, where the invalid package is the package to which the conversion code whose execution is invalid belongs.
[0124] When it is determined that the code execution fails, the execution failure information can be displayed to prompt that the change code execution fails, and the package name of the failed package can be displayed to facilitate the developer to locate it. The package name of the failed package can be obtained from the above data dictionary view.
[0125] In the disclosed embodiment, the changed code is automatically constructed through the client, including processes such as code conversion and automatic deployment, and the running status of the corresponding program package is obtained after deployment to determine the execution result of the code. The code running status can be monitored in real time. When the code execution result indicates that the code execution fails, the developer can quickly locate the failed code and repair it.
[0126] In a possible implementation, after obtaining the code execution result, a build record of the changed code is generated based on the code execution result, and the build record is stored in a build record log. The build record log records the build results of different changed codes, thereby realizing the recording and management of database system changes. Figure 7 As shown, the build record log includes branch information 701 and code running status 702 of each code branch, wherein the branch information includes the branch name and the development requirement information corresponding to the branch.
[0127] In the disclosed embodiment, the client realizes automatic recording of the change process of the database system by recording and constructing a record log, which facilitates the viewing and location of problems.
[0128] In an exemplary embodiment, Figure 8 As shown, the process of developing and automating code changes includes the following steps:
[0129] Step 801: Pull the code to be changed.
[0130] Developers can pull the code to be changed, which is the code version currently running on the database system.
[0131] Step 802, code development.
[0132] Step 803: Push the development code to the remote code repository.
[0133] After the developer completes code development, he / she pushes the development code to the remote code repository. ;
[0134] Step 804: Pull the development code from the remote code repository for testing.
[0135] Testers can pull development code from the remote code repository for testing.
[0136] Step 805, determine whether the code test passes. If passed, execute step 806; if not, execute step 802.
[0137] If the code test passes, the code can be deployed automatically. If it fails, the code needs to be redeveloped.
[0138] Step 806: Automatic code deployment.
[0139] The automatic code deployment is the process provided in the above embodiment that the client automatically deploys the changed code to the database server. The specific process can be referred to the above embodiment and will not be repeated here.
[0140] Step 807, determine whether the code automation deployment is successful, if successful, execute steps 808 and 809, if failed, execute step 802.
[0141] Whether the automatic code deployment is successful can be determined based on the test results of the running status of the target package to which the changed code belongs. If the running status indicates that the running is successful, the automatic code deployment is determined to be successful, and the successfully deployed changed code can be merged into the remote code library to synchronize the code version in the remote code library with the code version running in the current database system. If the running status indicates that the running is invalid, the automatic code deployment is determined to have failed and code development needs to continue.
[0142] Step 808, merging the code into the remote code repository.
[0143] After the changed code is successfully deployed to the database server, the code can be merged into the remote code repository.
[0144] Step 809: Feedback information indicating successful automatic code deployment.
[0145] Indicatively, you can send feedback code automation deployment success information via email.
[0146] The execution sequence of step 808 and step 809 may be synchronous or sequential, which is not limited in this embodiment.
[0147] In an embodiment of the present disclosure, a client is provided for the automated deployment of change code. Optionally, the client may be a container, and the client container is used to perform change operations on the database system. The client container is generated based on a client image, and the client image is associated with a code library. The process of creating a client container includes steps 1-2:
[0148] Step 1: Create a client image.
[0149] The client image may be an image file required to run the client, including the operating environment and configuration files. The client image is associated with the repository address of the code base to obtain the changed code based on the repository address.
[0150] Optionally, the client image is also associated with an automation script for automatically deploying the change code to the database server. When the user uses the client to make changes to the database system, the client can automatically execute the automation script to complete the change to the database system. Fig. 9 As shown, you can associate the created client image with the automation script in the configuration page, configure the client image in the compilation image configuration item: sql-plus tool dedicated image, and configure the automation script in the compilation script.
[0151] In an example, the script running process includes: proofreading the sqlplus encoding to UTF8; obtaining the change code from the git branch; proofreading the change code file encoding, and converting the change code file encoding from GBK to UTF-8; connecting to the target server EBS1 where the change code needs to be deployed, deploying the change code to EBS1 and executing it; and detecting the running status of the program package to which the change code belongs after being deployed to the target server.
[0152] Step 2: Create a client container based on the client image.
[0153] After the client image is created, a client container may be created based on the client image, and the change operation on the database system in the above embodiment may be performed through the client container.
[0154] Fig.10 1 is a schematic diagram of a structure of a device for determining a change in a database system provided by an exemplary embodiment of the present disclosure. The device can be used in the electronic device involved in the above embodiment. The electronic device includes the client described in the above embodiment. Specifically, the client can be used. The client is associated with a code library. The code library is used to manage different code versions of the database system. The device includes:
[0155] The code acquisition module 1001 is used to acquire, in response to a change operation on the database system, a change code for changing the database system from the code library;
[0156] A code deployment module 1002 is used to connect to a database server corresponding to the database system and deploy the changed code to the database server, on which the database system runs;
[0157] The system change module 1003 is used to make system changes to the database system based on the deployed change code.
[0158] In an exemplary embodiment, the code acquisition module 1001 is further used to:
[0159] Sending a changed code extraction command to the code repository, so that the code repository extracts the changed code from a code branch indicated by the changed code extraction command, where the code branch is a development branch created when developing the changed code;
[0160] The changed code extracted from the code library is obtained from the code library.
[0161] In an exemplary embodiment, the code library is used to compare the current code version stored in the database system with the unsubmitted code version in the code branch that has not been submitted to the code library to obtain the changed code, where the changed code is the code in the unsubmitted code version that is different from the current code version.
[0162] In an exemplary embodiment, the code deployment module 1002 is further used to:
[0163] Performing encoding conversion on the change code to obtain a conversion code, wherein the encoding type of the conversion code matches the encoding type used by the database system;
[0164] Connecting to the database server and deploying the conversion code to the database server;
[0165] The deployment-based change code makes system changes to the database system, including:
[0166] The conversion code is executed to make system changes to the database system.
[0167] In an exemplary embodiment, the apparatus further comprises:
[0168] The status detection module is used to detect the code running status and obtain the code execution result;
[0169] The result display module is used to display execution failure information and a package name of a failed package when the code execution result indicates that the code execution is failed. The failed package is the package to which the conversion code with failed execution belongs.
[0170] In an exemplary embodiment, the state detection module is further used to:
[0171] Determining, based on the code name of the changed code, a package identifier of a package to which the converted code belongs when it is run in the database system;
[0172] Based on the program package identifier, querying the running status of the program package in a data dictionary view corresponding to the database system, wherein the data dictionary view includes status and attribute information of all objects in the database system;
[0173] In response to the running status indicating that the program package running fails, determining the code execution result as code execution failure.
[0174] In an exemplary embodiment, the apparatus further comprises:
[0175] A record generation module is used to generate a construction record of the changed code based on the code execution result, and store the construction record in a construction record log.
[0176] In an exemplary embodiment, the code base is a Git repository;
[0177] The device also includes:
[0178] The warehouse association module is used to associate the warehouse address of the Git warehouse with the client, so that the client obtains the changed code from the Git warehouse based on the warehouse address.
[0179] In an exemplary embodiment, the client includes a client container, the client container is used to perform a change operation on the database system, the client container is generated based on a client image, and the client image is associated with the code library.
[0180] The changing device of the database system in the embodiment of the present disclosure corresponds to the embodiment of the changing method of the database system in the present disclosure, and the relevant contents can be referenced to each other, which will not be repeated here. The beneficial technical effects corresponding to the changing device of the database system in the embodiment of the present disclosure can refer to the corresponding beneficial technical effects of the corresponding exemplary method part above, which will not be repeated here.
[0181] In addition, an embodiment of the present disclosure further provides an electronic device, including:
[0182] Memory for storing computer programs;
[0183] The processor is used to execute the computer program stored in the memory, and when the computer program is executed, the method for changing the database system described in any of the above embodiments of the present disclosure is implemented.
[0184] Fig.11 This is a schematic diagram of the structure of an application embodiment of the electronic device disclosed in the present invention. Fig.11 To describe the electronic device according to the embodiment of the present disclosure. Fig.11 As shown, the electronic device includes one or more processors and memory.
[0185] The processor may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0186] The memory may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor may execute the program instructions to implement the database system change method and / or other desired functions of the various embodiments of the present disclosure described above.
[0187] In one example, the electronic device may further include: an input device and an output device, and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0188] In addition, the input device may also include, for example, a keyboard, a mouse, and the like.
[0189] The output device can output various information to the outside, including the determined distance information, direction information, etc. The output device can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.
[0190] Of course, to simplify, Fig.11 Only some of the components related to the present disclosure in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device may further include any other appropriate components.
[0191] In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the method for changing the database system according to various embodiments of the present disclosure described in the above part of this specification.
[0192] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0193] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, causes the processor to execute the steps of the method for changing a database system according to various embodiments of the present disclosure described in the above part of this specification.
[0194] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0195] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various media that can store program codes.
[0196] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0197] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0198] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.
[0199] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
[0200] It should also be noted that in the apparatus, device and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0201] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0202] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A method for changing a database system, characterized in that: The method is used for a client, the client is associated with a code library, and the code library is used to manage different code versions of a database system. The method includes: In response to a change operation on the database system, obtaining a change code for changing the database system from the code library; Connecting to a database server corresponding to the database system, deploying the change code to the database server, and the database system runs based on the database server; Make system changes to the database system based on the deployed change code.
2. The method according to claim 1, characterized in that The acquiring, from the code library, a change code for changing the database system includes: Sending a changed code extraction command to the code repository, so that the code repository extracts the changed code from a code branch indicated by the changed code extraction command, where the code branch is a development branch created when developing the changed code; The changed code extracted from the code library is obtained from the code library.
3. The method according to claim 2, characterized in that The code library is used to compare the current code version of the stored database system with the unsubmitted code version in the code branch that has not been submitted to the code library to obtain the changed code, where the changed code is the code in the unsubmitted code version that is different from the current code version.
4. The method according to claim 1, characterized in that: The step of connecting to a database server corresponding to the database system and deploying the changed code to the database server includes: Performing encoding conversion on the change code to obtain a conversion code, wherein the encoding type of the conversion code matches the encoding type used by the database system; Connecting to the database server and deploying the conversion code to the database server; The deployment-based change code makes system changes to the database system, including: The conversion code is executed to make system changes to the database system.
5. The method according to claim 4, characterized in that After executing the conversion code, the method further includes: Detect the code running status and obtain the code execution results; In the case where the code execution result indicates that the code execution is invalid, execution failure information and a package name of the invalid package are displayed, where the invalid package is the package to which the conversion code whose execution is invalid belongs.
6. The method according to claim 5, characterized in that The detecting code running status and obtaining the code execution result include: Determining, based on the code name of the changed code, a package identifier of a package to which the converted code belongs when it is run in the database system; Based on the program package identifier, querying the running status of the program package in a data dictionary view corresponding to the database system, wherein the data dictionary view includes status and attribute information of all objects in the database system; In response to the running status indicating that the program package running fails, determining the code execution result as code execution failure.
7. The method according to any one of claims 1 to 6, characterized in that: The code base is a Git repository. Before obtaining the change code for changing the database system from the code base in response to the change operation on the database system, the method further includes: The repository address of the Git repository is associated with the client so that the client obtains the changed code from the Git repository based on the repository address.
8. The method according to any one of claims 1 to 6, characterized in that: The client includes a client container, which is used to perform a change operation on the database system. The client container is generated based on a client image, and the client image is associated with the code library.
9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor is used to execute the computer program stored in the memory, and when the computer program is executed, the method for changing the database system described in any one of claims 1 to 8 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for changing the database system described in any one of claims 1 to 8 is implemented.