Script online method, device, storage medium and electronic device
By scanning and building the relationship between the target table and the source table in the script, task dependencies are created, which solves the problem of unstable dependency configuration during script online and improves the success rate and stability of the online script.
Patent Information
- Application Number
- CN201911348741.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-24
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2039-12-24
AI Technical Summary
During the script online process, the task dependency configuration is unstable, which makes it difficult to guarantee the success rate of the script online, and requires a high cost to remedy.
By scanning the relevant statements of the target table and source table in the script to be launched, obtain and build the correlation relationship, and create task dependencies based on these relationships to ensure the stability and success rate of the script launch.
Accurately and stably create task dependencies, improve the success rate and stability of script launch, and reduce remediation costs caused by dependency errors.
Smart Images

Figure CN111176718B
Abstract
Description
Background Art
[0002] Script launch means that after the script developer has developed the script to be launched, he or she adds the task name of the script to be launched, configures the dependency relationship between other script scheduling tasks, and then launches it to the scheduled system.
[0003] At present, in order to ensure that the script to be launched can complete the task according to the expected frequency, rules and order after it is launched, it is necessary to configure the task dependency when launching the script. If the task dependency is wrong, the target task cannot be completed smoothly, and it will cost a lot to remedy it. At present, there is a problem that the success rate of script launch is difficult to guarantee due to the unstable configuration of task dependency.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the present application is to provide a script online solution, and further, at least to a certain extent, according to one aspect of the present application, a script online method is provided, including:
[0006] Scan the table name after the target table-related statements in the script to be launched to obtain the target table set;
[0007] Scan the table name after the source table related statement in the script to be put online to obtain the source table set;
[0008] Acquire a first identifier of a target table-related statement associated with each target table in the target table set, and acquire a second identifier of a source table-related statement associated with each source table in the source table set;
[0009] Obtaining an association relationship between the first identifier and the second identifier;
[0010] A task dependency relationship of the script to be put online is created based on the association relationship, the target table set and the source table set, so as to put the script online based on the task dependency relationship.
[0011] In an exemplary embodiment of the present application, the step of obtaining a first identifier of a target table related statement associated with each target table in the target table set includes:
[0012] Scan all statements related to the target table in the script to be launched;
[0013] Determine the table name after the statement related to the target table;
[0014] According to the target table related statement and the table name after the target table related statement, a first identifier is added to the target table related statement.
[0015] In an exemplary embodiment of the present application, the step of obtaining the second identifier of the source table-related statement associated with each source table in the source table set includes:
[0016] Scan all source table-related statements of the script to be launched;
[0017] Determine the table name after the source table related statement;
[0018] According to the source table related statement and the table name after the source table related statement, a second identifier is added to the source table related statement.
[0019] In an exemplary embodiment of the present application, after obtaining a first identifier of a target table-related statement associated with each target table in the target table set and obtaining a second identifier of a source table-related statement associated with each source table in the source table set, the method further includes:
[0020] Obtain a first script statement from which the target table-related statement corresponding to the first identifier originates and a second script statement from which the source table-related statement corresponding to the second identifier originates;
[0021] Construct a related statement association relationship table of the first identifier, the second identifier, the first script statement, and the second script statement.
[0022] In an exemplary embodiment of the present application, the acquiring the association relationship between the first identifier and the second identifier includes:
[0023] Obtaining a preset task table of the script to be put online, wherein the preset task table stores the task association relationship of each task and the script statement corresponding to each task;
[0024] The association relationship between the first identifier and the second identifier is obtained based on the preset task table and the statement association relationship table.
[0025] In an exemplary embodiment of the present application, the step of launching a script based on the task dependency relationship includes:
[0026] Based on the task dependency, retrieve all tasks of the script file;
[0027] Get the table name after the from statement and join statement in each task, generate the documents required for script online, and launch the script to be launched.
[0028] In an exemplary embodiment of the present application, the method further includes:
[0029] Scan the script to be put online according to a preset scanning algorithm to determine whether the script to be put online has a script error;
[0030] When the script to be put online has a script error, the task name and error cause of the script error source are output.
[0031] According to one aspect of the present application, a script online device is provided, including:
[0032] The first scanning module is used to scan the table name after the target table related statement in the script to be launched to obtain the target table set;
[0033] A second scanning module is used to scan the table name after the source table related statement in the script to be put online to obtain a source table set;
[0034] an identifier acquisition module, used to acquire a first identifier of a target table-related statement associated with each target table in the target table set, and to acquire a second identifier of a source table-related statement associated with each source table in the source table set;
[0035] An association relationship acquisition module, used to acquire the association relationship between the first identifier and the second identifier;
[0036] The online module is used to create a task dependency relationship of the script to be online based on the association relationship, the target table set and the source table set, so as to launch the script online based on the task dependency relationship.
[0037] According to one aspect of the present application, a computer-readable storage medium is provided, on which an instruction program is stored. When the instruction program is executed by a processor, any of the above-mentioned methods is implemented.
[0038] According to one aspect of the present application, an electronic device is provided, including:
[0039] A processor; and a memory for storing an instruction program for the processor; wherein the processor is configured to perform any of the above-mentioned methods by executing the instruction program.
[0040] The present application provides a script online method and device, which scans the table name after the target table-related statement in the script to be online to obtain a target table set; scans the table name after the source table-related statement in the script to be online to obtain a source table set; obtains the first identifier of the target table-related statement associated with each target table in the target table set, and obtains the second identifier of the source table-related statement associated with each source table in the source table set; obtains the association relationship between the first identifier and the second identifier; creates the task dependency relationship of the script to be online based on the association relationship, the target table set and the source table set, and then the script can be online based on the task dependency relationship. In this way, based on the association relationship between each source table and the source table-related statement, and the association relationship between each target table and the target table-related statement, the task dependency relationship between all target tables and source tables can be accurately determined, and the task dependency relationship of the script to be online can be accurately and stably created, thereby ensuring the success rate and stability of the script to be online.
[0041] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0043] Figure 1 A flowchart of a script online method is schematically shown.
[0044] Figure 2 A diagram schematically shows an example application scenario of a script online method.
[0045] Figure 3 A flowchart of a method for obtaining an association relationship is schematically shown.
[0046] Figure 4 A block diagram of a script online device is schematically shown.
[0047] Figure 5 An example block diagram of an electronic device for implementing the above script online method is schematically shown.
[0048] Figure 6 A computer-readable storage medium for implementing the above script online method is schematically shown. DETAILED DESCRIPTION
[0049] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present application will be more comprehensive and complete, and the concept of the example embodiments will be fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical solutions of the present application may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present application.
[0050] In addition, the accompanying drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0051] This exemplary embodiment first provides a script online method, which can be run on a server, a server cluster, or a cloud server, etc. Of course, those skilled in the art can also run the method of the present invention on other platforms as required, and this exemplary embodiment does not specifically limit this. Figure 1 As shown, the script online method may include the following steps:
[0052] Step S110, scanning the table name after the target table related statement in the script to be put online to obtain the target table set;
[0053] Step S120, scanning the table names after the source table related statements in the script to be put online to obtain a source table set;
[0054] Step S130, obtaining a first identifier of a target table-related statement associated with each target table in the target table set, and obtaining a second identifier of a source table-related statement associated with each source table in the source table set;
[0055] Step S140, obtaining an association relationship between the first identifier and the second identifier;
[0056] Step S150: creating a task dependency relationship of the script to be launched based on the association relationship, the target table set and the source table set, so as to launch the script based on the task dependency relationship.
[0057] In the above script online method, first, the table name after the target table related statement in the script to be online is scanned to obtain the target table set; a set of task tables for the script language to complete the expected task can be obtained. Then, the table name after the source table related statement in the script to be online is scanned to obtain the source table set; a set of all source tables required for the task in the script to be online can be obtained. Further, the first identifier of the target table related statement associated with each target table in the target table set is obtained, and the second identifier of the source table related statement associated with each source table in the source table set is obtained; the script statement can be used to complete the task to add a corresponding identifier, which is used to quickly determine the task association relationship between each statement and the statements. Then, the association relationship between the first identifier and the second identifier is obtained; the association relationship between each target table and the source table in the script to be online can be determined. Finally, the task dependency relationship of the script to be online is created based on the association relationship, the target table set and the source table set, so as to carry out the script online based on the task dependency relationship. In this way, based on the association between each source table and its related statements, and the association between each target table and its related statements, the task dependencies between all target tables and source tables can be accurately determined, and the task dependencies of the scripts to be launched can be accurately and stably created, thereby ensuring the success rate and stability of the scripts to be launched.
[0058] Below, each step in the script online method described above in this example implementation will be explained and illustrated in detail with reference to the accompanying drawings.
[0059] In step S110, the table name after the target table related statement in the script to be put online is scanned to obtain the target table set.
[0060] In the implementation of this example, reference Figure 2 As shown, the server 201 scans the table names after the target table related statements in the script to be uploaded on the server 202 to obtain the target table set. In this way, the server 201 can create the task dependency relationship of the script to be uploaded in the subsequent steps. It can be understood that, according to the needs, the server 202 can also directly scan the table names after the target table related statements in the script to be uploaded to obtain the target table set. Among them, the server 201 and the server 202 can be any device with processing capabilities, such as a computer, a microprocessor, etc., and are not specifically limited here.
[0061] The script to be launched is a script that is ready to be launched on the scheduled system, and can include scripting languages such as SQL statements. The target table in the script to be launched is the task table for the script language to complete the expected task. Statements related to the target table, such as the insert overwrite statement, call data from other source tables. This statement first removes the data from the target table and then inserts new data. By scanning the target table-related statements in the script to be launched, the table name that follows it, that is, the target table, can be scanned at the same time, and the set of all target tables in the script to be launched can be obtained. Then, all task associations can be completely determined in subsequent steps based on all target tables that complete the expected tasks in the script to be launched.
[0062] In step S120, the table names after the source table related statements in the script to be put online are scanned to obtain a source table set.
[0063] In the implementation of this example, source table related statements such as from statements and join statements are the tables from which the target table must rely on to complete the expected task, and are usually called through source table related statements. The source table is the table from which the target table needs to call the data to complete the expected task. By scanning the table name after the source table related statement in the script to be launched, the set of all source tables required for the task in the script to be launched can be obtained, ensuring that the complete task association relationship can be determined in the subsequent steps.
[0064] In step S130, a first identifier of a target table-related statement associated with each target table in the target table set is obtained, and a second identifier of a source table-related statement associated with each source table in the source table set is obtained.
[0065] In the implementation of this example, the statements related to the target table and the statements related to the source table complete all the tasks of the script to be launched by cooperating with each other, and different statements are used to complete different tasks. At the same time, the relationship between the statements related to the target table and the statements related to the source table exists in a circular call, a direct call, and other relationships. Therefore, when creating the script to be launched, rules can be set in advance according to the script statement tags, and corresponding identifiers can be added according to the tasks that the script statements are used to complete, which can be used to quickly determine the task association relationship between each statement and the statements.
[0066] In one implementation of this example, obtaining a first identifier of a target table related statement associated with each target table in the target table set includes:
[0067] Scan all statements related to the target table in the script to be launched;
[0068] Determine the table name after the statement related to the target table;
[0069] According to the target table related statement and the table name after the target table related statement, a first identifier is added to the target table related statement.
[0070] For example, if the table name after the target table related statement is A, then the first identifier Am can be added to the target table related statement according to the target table related statement and the table name after the target table related statement, where m is the sequence number of the target table related statement scanned, etc. The same label can be added to the target table related statements corresponding to the same table name to ensure the accuracy of the determination of the task dependency in the subsequent steps.
[0071] In one implementation of this example, obtaining the second identifier of the source table-related statement associated with each source table in the source table set includes:
[0072] Scan all source table-related statements of the script to be launched;
[0073] Determine the table name after the source table related statement;
[0074] According to the source table related statement and the table name after the source table related statement, a second identifier is added to the source table related statement.
[0075] For example, if the table name after the source table related statement is B, then the second identifier Bn can be added to the source table related statement according to the source table related statement and the table name after the source table related statement, where n is the sequence number of the source table related statement scanned, etc. The same label can be added to the source table related statements corresponding to the same table name to ensure the accuracy of the determination of the task dependency in the subsequent steps.
[0076] In one implementation of this example, after obtaining a first preset identifier of a target table-related statement associated with each target table in the target table set and obtaining a second preset identifier of a source table-related statement associated with each source table in the source table set, the method further includes:
[0077] Obtaining the first preset identifier and the second preset identifier;
[0078] Obtain a first script statement from which a target table-related statement corresponding to the first preset identifier originates and a second script statement from which a source table-related statement corresponding to the second preset identifier originates;
[0079] Construct a related statement association relationship table of the first preset identifier, the second preset identifier, the first script statement, and the second script statement.
[0080] The target table related statements and the source table related statements are clauses in the script statements that complete the predetermined tasks. By obtaining the first script statement from which the target table related statements come and the second script statement from which the source table related statements come, the association relationship between each target related statement and the source table related statement can be determined, for example, whether they come from the same script statement, or from script statements with a calling relationship. Among them, the first script statement and the second script statement refer to complete statements that can complete a sub-expected task in the script to be put online. By constructing a related statement association relationship table of the first preset identifier, the second preset identifier, the first script statement, and the second script statement, the association relationship of each statement can be quickly determined.
[0081] In step S140, the association relationship between the first identifier and the second identifier is obtained.
[0082] In the implementation of this example, the first preset identifier corresponds to the target table related statement, and the second preset identifier corresponds to the source table related statement. The association relationship between the two may include whether they correspond to the same script statement, and the logical relationship between the two when completing the target task, etc. By obtaining the association relationship between the first preset identifier and the second preset identifier, the association relationship between each target table and the source table in the script to be launched can be accurately determined, ensuring that no redundant or erroneous association relationship between the target table and the source table is determined, and at the same time, the non-existent dependency relationship between the target table and the source table can be determined in a timely manner, ensuring the stability of the script to be launched.
[0083] In one implementation of this example, reference Figure 3 As shown, obtaining the association relationship between the first identifier and the second identifier includes:
[0084] Step S310, obtaining a preset task table of the script to be put online, wherein the preset task table stores the task association relationship of each task and the script statement corresponding to each task;
[0085] Step S320: acquiring the association relationship between the first identifier and the second identifier based on the preset task table and the related statement association relationship table.
[0086] Through the task association relationship and the script statements corresponding to each task, the relationship between all the script statements used to complete the tasks of the script to be launched can be determined, such as circular references, direct calls, etc. The statement association relationship table stores the identifiers of the target table-related statements and the source table-related statements, as well as the association relationship between the script statements from which the target table-related statements and the source table-related statements are derived; then, based on the identifiers of the target table-related statements and the source table-related statements in the association relationship table, as well as the association relationship between the script statements from which the target table-related statements and the source table-related statements are derived, the association relationship between each target table-related statement and the source table-related statement can be obtained; finally, the task association relationship between the target table-related statements and the source table-related statements and the demand call relationship between the two can be determined. In addition, the accurate dependency relationship between the target table and the source table can be accurately determined, useless dependencies can be eliminated, and the rationality of the scheduling of the script launch can be ensured.
[0087] In step S150, a task dependency relationship of the script to be launched is created based on the association relationship, the target table set and the source table set, so as to launch the script based on the task dependency relationship.
[0088] In one implementation of this example, the association relationship is the association relationship between all target table related statements and source table related statements, and each target table related statement and source table related statement corresponds to a target table or source table. At the same time, the target table set and the source table set include all source tables and target tables in the script to be launched. In this way, based on the association relationship between each source table and the source table related statement, and the association relationship between each target table and the target table related statement, the task dependency relationship between all target tables and source tables can be accurately determined, and the task dependency relationship of the script to be launched can be accurately created to ensure the success rate of the script to be launched.
[0089] In one implementation of this example, launching a script based on the task dependency relationship includes:
[0090] Based on the task dependency, retrieve all tasks of the script file;
[0091] Get the table name after the from statement and join statement in each task, generate the documents required for script online, and launch the script to be launched.
[0092] In one implementation of this example, it also includes:
[0093] Scan the script to be put online according to a preset scanning algorithm to determine whether the script to be put online has a script error;
[0094] When the script to be put online has a script error, the task name and error cause of the script error source are output.
[0095] Search for low-level error scripts in the script, such as whether the association condition has the same field associated with the same table field, A.POLICY_NO = A.POLICY_NO, which causes the script to run very slowly, occupying resources, and outputting the task name and cause of the error with a low-level error.
[0096] This application also provides a script online device. Figure 4 As shown, the script online device may include a first scanning module 410, a second scanning module 420, an identification acquisition module 430, an association relationship acquisition module 440 and an online module 450. Among them:
[0097] The first scanning module 410 is used to scan the table name after the target table related statement in the script to be put online to obtain the target table set;
[0098] The second scanning module 420 is used to scan the table name after the source table related statement in the script to be put online to obtain a source table set;
[0099] The identifier acquisition module 430 is used to acquire a first identifier of a target table-related statement associated with each target table in the target table set, and acquire a second identifier of a source table-related statement associated with each source table in the source table set;
[0100] The association relationship acquisition module 440 is used to acquire the association relationship between the first identifier and the second identifier;
[0101] The online module 450 is used to create a task dependency relationship of the script to be online based on the association relationship, the target table set and the source table set, so as to carry out script online based on the task dependency relationship.
[0102] The specific details of each module in the above-mentioned script online device have been described in detail in the corresponding script online method, so they will not be repeated here.
[0103] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0104] In addition, although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0105] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0106] In an exemplary embodiment of the present application, an electronic device capable of implementing the above method is also provided.
[0107] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".
[0108] Refer to the following Figure 5 The electronic device 500 according to this embodiment of the present invention is described. Figure 5 The electronic device 500 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0109] like Figure 5 As shown, the electronic device 500 is in the form of a general computing device. The components of the electronic device 500 may include but are not limited to: at least one processing unit 510, at least one storage unit 520, and a bus 530 connecting different system components (including the storage unit 520 and the processing unit 510).
[0110] The storage unit stores program codes, which can be executed by the processing unit 510, so that the processing unit 510 performs the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification. For example, the processing unit 510 can perform the following steps: Figure 1 Follow the steps shown in .
[0111] The storage unit 520 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 5201 and / or a cache storage unit 5202 , and may further include a read-only storage unit (ROM) 5203 .
[0112] The storage unit 520 may also include a program / utility 5204 having a set (at least one) of program modules 5205, such program modules 5205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0113] Bus 530 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0114] The electronic device 500 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a client to interact with the electronic device 500, and / or any device that enables the electronic device 500 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 550, which may include a display unit 540 connected to the input / output (I / O) interface 550. Furthermore, the electronic device 500 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 560. As shown, the network adapter 560 communicates with other modules of the electronic device 500 via a bus 530. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0115] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0116] In an exemplary embodiment of the present application, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to perform the steps according to various exemplary implementations of the present invention described in the above "Exemplary Method" section of the present specification.
[0117] refer to Figure 6 As shown, a program product 600 for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0118] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, 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.
[0119] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0120] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0121] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, 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 client computing device, partially on the client device, as a separate software package, partially on the client computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the client computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0122] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0123] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application. The specification and embodiments are to be regarded as exemplary only, and the true scope and spirit of the present application are indicated by the claims.
Claims
1. A script online method, characterized in that: include: Scan the table name after the target table-related statements in the script to be launched to obtain the target table set; Scan the table name after the source table related statement in the script to be put online to obtain the source table set; Obtain a first identifier of a target table-related statement associated with each target table in the target table set, and obtain a second identifier of a source table-related statement associated with each source table in the source table set, wherein the first identifier is a sequence number of a sequence in which the target table-related statement is scanned, and the second identifier is a sequence number of a sequence in which the source table-related statement is scanned; Obtain a first script statement from which the target table-related statement corresponding to the first identifier originates and a second script statement from which the source table-related statement corresponding to the second identifier originates; Constructing a related statement association relationship table among the first identifier, the second identifier, the first script statement, and the second script statement, wherein the related statement association relationship table is used to indicate whether the target table related statement and the source table related statement are derived from the same script statement, and whether there is a circular call or direct call relationship; Obtaining a preset task table of the script to be put online, wherein the preset task table stores the task association relationship of each task and the script statement corresponding to each task; Acquire an association relationship between the first identifier and the second identifier based on the preset task table and the related statement association relationship table, wherein the association relationship includes whether the first identifier and the second identifier correspond to the same script statement, and a logical relationship between the first identifier and the second identifier when completing a target task; Scan the script to be put online according to a preset scanning algorithm to determine whether the script to be put online has a script error; When the script to be put online has a script error, output the task name and error cause of the script error source; Creating a task dependency relationship of the script to be put online based on the association relationship, the target table set and the source table set, so as to retrieve all tasks of the script file based on the task dependency relationship; Get the table name after the from statement and join statement in each task, generate the documents required for script online, and launch the script to be launched online.
2. The method according to claim 1, characterized in that The obtaining a first identifier of a target table related statement associated with each target table in the target table set includes: Scan all statements related to the target table in the script to be launched; Determine the table name after the statement related to the target table; According to the target table related statement and the table name after the target table related statement, a first identifier is added to the target table related statement.
3. The method according to claim 1, characterized in that The obtaining the second identifier of the source table related statement associated with each source table in the source table set includes: Scan all source table-related statements of the script to be launched; Determine the table name after the source table related statement; According to the source table related statement and the table name after the source table related statement, a second identifier is added to the source table related statement.
4. A script online device, characterized in that: include: The first scanning module is used to scan the table name after the target table related statement in the script to be launched to obtain the target table set; A second scanning module is used to scan the table name after the source table related statement in the script to be put online to obtain a source table set; an identifier acquisition module, used to acquire a first identifier of a target table-related statement associated with each target table in the target table set, and acquire a second identifier of a source table-related statement associated with each source table in the source table set, wherein the first identifier is a sequence number of a sequence in which the target table-related statement is scanned, and the second identifier is a sequence number of a sequence in which the source table-related statement is scanned; An association relationship acquisition module, used to acquire a first script statement from which a target table-related statement corresponding to the first identifier originates and a second script statement from which a source table-related statement corresponding to the second identifier originates; Constructing a related statement association relationship table among the first identifier, the second identifier, the first script statement, and the second script statement, wherein the related statement association relationship table is used to indicate whether the target table related statement and the source table related statement are derived from the same script statement, and whether there is a circular call or direct call relationship; Obtaining a preset task table of the script to be put online, wherein the preset task table stores the task association relationship of each task and the script statement corresponding to each task; Acquire an association relationship between the first identifier and the second identifier based on the preset task table and the related statement association relationship table, wherein the association relationship includes whether the first identifier and the second identifier correspond to the same script statement, and a logical relationship between the first identifier and the second identifier when completing a target task; Scan the script to be put online according to a preset scanning algorithm to determine whether the script to be put online has a script error; When the script to be put online has a script error, output the task name and error cause of the script error source; An online module, used to create a task dependency relationship of the script to be online based on the association relationship, the target table set and the source table set, so as to retrieve all tasks of the script file based on the task dependency relationship; Get the table name after the from statement and join statement in each task, generate the documents required for script online, and launch the script to be launched online.
5. A computer-readable storage medium having an instruction program stored thereon, characterized in that: When the instruction program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
6. An electronic device, characterized in that: include: processor; as well as A memory for storing an instruction program of the processor; wherein the processor is configured to execute the method according to any one of claims 1 to 3 by executing the instruction program.
