Program data processing method, device, electronic device and computer readable medium
By obtaining and analyzing the substructure and status information of the target program, recording data operation records, and automatically cleaning the database, it solves the problem of dirty data caused by abnormal error reports in complex logical scheduled tasks, achieves rapid repair and monitoring, and reduces the cost of online business influence.
Patent Information
- Application Number
- CN202010546186.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-16
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-06-16
AI Technical Summary
In scheduled tasks with complex logic, abnormal error reports lead to the generation of dirty data. Manual repair is time-consuming and easy to miss. Repairs cannot be completed quickly, timely and accurately, which affects online business. Moreover, the background log is not intuitive and makes it difficult to trace the problem.
By obtaining the substructure and status information of the target program, the data operation record is recorded. If the substructure is in an alarm state, the database is automatically cleaned, alarm information is generated, and the target program is re-executed based on repair feedback to achieve data rollback and monitoring.
It achieves refined monitoring and automatic rollback of target programs, reduces the impact of abnormal error reports and dirty data on online businesses, and improves repair efficiency and data integrity.
Smart Images

Figure CN113778775B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a program data processing method, device, electronic device, and computer-readable medium. Background Art
[0002] The implementation of many businesses in Internet application scenarios is inseparable from scheduled tasks. The characteristics of scheduled tasks are based on the scheduled time set by the system, specifying the time after which the execution will start and the execution cycle. When the specified time is reached, the task will be automatically triggered for execution, rather than being executed based on the user's operation on the web page. By executing a series of code logic, the user's business needs can be met.
[0003] For business codes of timed tasks with complex logic, the code logic chain is long. Once an exception is thrown during business execution and dirty data is generated, it will affect the online system business. When encountering this situation, dirty data is usually repaired one by one manually, but manual repair is time-consuming and labor-intensive, and it is easy to miss something. The repair is not thorough, and the repair work cannot be completed quickly, timely and accurately, which can never avoid the impact on online business.
[0004] In addition, when debugging the code, the code is usually repaired based on the background log. However, the background log cannot directly reflect the process execution status. Debugging the code based on the background log will lack a more intuitive monitoring of the entire process execution trajectory. And after encountering an abnormal error, repairing the code and re-launching the system application requires redeploying the system application. This process may cause the previous background log to be lost, which is not convenient for tracing back and locating the problem.
[0005] Therefore, a new program data processing method, device, electronic device and computer-readable medium are needed.
[0006] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention
[0007] In view of this, the embodiments of the present disclosure provide a program data processing method, device, electronic device and computer-readable medium, which can monitor the target program and automatically roll back and restore the tampered data in a timely manner when dirty data is generated, thereby reducing the impact of abnormalities such as abnormal errors and dirty data on online business.
[0008] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0009] According to a first aspect of an embodiment of the present disclosure, a program data processing method is proposed, the method comprising: obtaining a target program; analyzing the target program to obtain at least one substructure in the target program and status information of at least one of the substructures during execution; obtaining a data operation record of at least one of the substructures; if at least one of the substructures has a target substructure whose status information is in an alarm state, cleaning a database according to the data operation record of at least one of the substructures.
[0010] In an exemplary embodiment of the present disclosure, the method further includes: generating an alarm message according to the target substructure; after receiving a repair feedback in response to the alarm message, obtaining input data of the target program and the repaired target program; and executing the repaired target program based on the input data to obtain a processing result.
[0011] In an exemplary embodiment of the present disclosure, obtaining a data operation record of at least one of the substructures includes: if the substructure includes a new operation, storing the data of the new operation in the data operation record with a first identifier; if the substructure includes a deletion operation, storing the data of the deletion operation in the data operation record with a second identifier; if the substructure includes an update operation, storing the initial data and update data of the update operation in the data operation record with a third identifier.
[0012] In an exemplary embodiment of the present disclosure, cleaning database data according to the data operation record of the target substructure includes: if the data operation record includes data with a first identifier, deleting the data with the first identifier from the database; if the data operation record includes data with a second identifier, adding the data with the second identifier to the database; if the data operation record includes data with a third identifier, updating the updated data in the database according to the initial data with the third identifier.
[0013] In an exemplary embodiment of the present disclosure, the method further includes: determining a hierarchical relationship between at least one of the substructures; organizing at least one of the substructures into a tree-like hierarchical diagram according to the hierarchical relationship; and displaying the tree-like hierarchical diagram on a display screen.
[0014] In an exemplary embodiment of the present disclosure, displaying the tree hierarchy diagram on a display screen includes: determining a color identification of the substructure in the tree hierarchy diagram based on the status information of at least one of the substructures; and displaying the tree hierarchy diagram on the display screen based on the color identification of at least one of the substructures.
[0015] In an exemplary embodiment of the present disclosure, organizing at least one of the substructures into a tree-like hierarchical graph according to the hierarchical relationship includes: if the hierarchical relationship includes a loop structure, determining the substructure corresponding to the loop structure as a parallel branch; if the hierarchical relationship includes a determination structure, determining the substructure corresponding to the determination structure as a parallel branch; if the hierarchical relationship includes an assignment structure, determining the substructure corresponding to the assignment structure as a series branch; if the hierarchical relationship includes a call structure, determining the substructure corresponding to the call structure as a series branch; organizing at least one of the substructures into the tree-like hierarchical graph according to the parallel branches and the series branches.
[0016] According to a second aspect of an embodiment of the present disclosure, a program data processing device is proposed, the device comprising: a program acquisition module, configured to acquire a target program; a program analysis module, configured to analyze the target program, obtain at least one substructure in the target program and status information of at least one of the substructures during execution; an operation record module, configured to obtain a data operation record of at least one of the substructures; and a data cleaning module, configured to clean a database according to the data operation record of at least one of the substructures if at least one of the substructures has a target substructure whose status information is an alarm state.
[0017] According to the third aspect of an embodiment of the present disclosure, an electronic device is proposed, which includes: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement any of the program data processing methods described above.
[0018] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the program data processing method as described in any one of the above items is implemented.
[0019] According to the program data processing method, device, electronic device and computer-readable medium provided by certain embodiments of the present disclosure, according to the program data processing method provided by the embodiments of the present disclosure, the target program is analyzed to obtain the substructure, and the status information and data operation records of the substructure are recorded, so that the target program can be finely monitored. And when the status information of the target substructure is in an alarm state, the database can be automatically cleaned according to the data operation record to restore the program running environment to its initial state. The technical solution of the present disclosure can realize the monitoring of the target program, and when dirty data is generated, it can automatically roll back and restore the tampered data in a timely manner, thereby reducing the impact of abnormalities such as abnormal errors and dirty data on online business.
[0020] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. The drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can also be obtained based on these drawings without creative work.
[0022] Figure 1 is a system block diagram of a program data processing method and device according to an exemplary embodiment;
[0023] Figure 2 is a flow chart of a program data processing method according to an exemplary embodiment;
[0024] Figure 3 is a flow chart of a program data processing method according to an exemplary embodiment;
[0025] Figure 4 is a flow chart of a program data processing method according to an exemplary embodiment;
[0026] Figure 5 is a flow chart of a program data processing method according to an exemplary embodiment;
[0027] Figure 6 is a flow chart of a program data processing method according to an exemplary embodiment;
[0028] Figure 7 is a flow chart of a program data processing method according to another exemplary embodiment;
[0029] Figure 8 is a flow chart of a program data processing method according to another exemplary embodiment;
[0030] Fig. 9 is a flow chart of a program data processing method according to another exemplary embodiment;
[0031] Fig.10 is a diagram showing a display interface of a tree-like hierarchical diagram according to an exemplary embodiment;
[0032] Fig.11 is a block diagram of a program data processing device according to an exemplary embodiment;
[0033] Fig.12is a block diagram of an electronic device according to an exemplary embodiment;
[0034] Fig.13 The present invention is a schematic diagram showing a computer-readable storage medium according to an exemplary embodiment. DETAILED DESCRIPTION
[0035] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that the present invention will be comprehensive and complete and fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0036] 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 invention. However, those skilled in the art will appreciate that the technical solution of the present invention 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 methods, devices, implementations or operations are not shown or described in detail to avoid blurring various aspects of the present invention.
[0037] The accompanying drawings are only schematic illustrations of the present invention, and the same reference numerals in the drawings represent the same or similar parts, so their repeated description will be omitted. Some block diagrams shown in the accompanying drawings do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0038] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and steps, nor must they be executed in the order described. For example, some steps can be decomposed, and some steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0039] Exemplary embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0040] Figure 1 The present invention is a system block diagram showing a method and device for processing program data according to an exemplary embodiment.
[0041] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for the program data processing system operated by the user using the terminal devices 101, 102, and 103. The background management server may analyze and process the received program data processing request and other data, and feed back the processing results (such as alarm information generated according to the target substructure and the status information of the substructure - only as an example) to the terminal device.
[0042] The server 105 may, for example, obtain the target program; the server 105 may, for example, analyze the target program to obtain at least one substructure in the target program and state information of at least one substructure during execution; the server 105 may, for example, obtain a data operation record of at least one substructure. The server 105 may, for example, clean the database according to the data operation record of at least one substructure if at least one substructure has a target substructure with state information in an alarm state.
[0043] The server 105 may be a physical server, or may be composed of a plurality of servers, a portion of the server 105 may be used as a program data processing task submission system in the present disclosure, for obtaining tasks to execute program data processing commands; and a portion of the server 105 may be used as a program data processing system in the present disclosure, for obtaining a target program; analyzing the target program to obtain at least one substructure in the target program and status information of at least one substructure during execution; obtaining a data operation record of at least one substructure; if at least one substructure has a target substructure with status information in an alarm state, cleaning the database according to the data operation record of at least one substructure.
[0044] According to the program data processing method and device provided by the embodiments of the present disclosure, it is possible to monitor the target program and automatically roll back and restore the tampered data in a timely manner when dirty data is generated, thereby reducing the impact of abnormalities such as abnormal errors and dirty data on online business.
[0045] Figure 2 1 is a flowchart of a program data processing method according to an exemplary embodiment. The program data processing method provided in the embodiment of the present disclosure can be executed by any electronic device with computing and processing capabilities, such as terminal devices 101, 102, 103 and / or server 105. In the following embodiments, the server execution method is used as an example for illustration, but the present disclosure is not limited thereto. The program data processing method 20 provided in the embodiment of the present disclosure may include steps S202 to S208.
[0046] like Figure 2 As shown, in step S202, the target program is obtained.
[0047] In the embodiment of the present disclosure, the target program may be a business program currently running online, such as but not limited to a scheduled task that is pre-set to be executed online.
[0048] In step S204, the target program is analyzed to obtain at least one substructure in the target program and state information of the at least one substructure during execution.
[0049] In the disclosed embodiment, the substructure is used to divide the target program. For example, the target program can be divided according to the method, or the target program can be analyzed to obtain the program control flow relationship of the target program, and the target program can be divided according to the program control flow relationship to obtain at least one substructure. The state information of the substructure may include one or more of the following situations: unexecuted state, executed and no error state, and alarm state. Among them, the substructure of the alarm state is a hierarchical structure of executed and error state.
[0050] In step S206, a data operation record of at least one substructure is obtained.
[0051] In the embodiment of the present disclosure, the data operation record of the substructure is used to describe the operation record of the substructure involving the operation database. Preferably, the data operation record of the substructure may also include the input data of the target program.
[0052] In step S208, if at least one substructure has a target substructure whose status information is an alarm status, the database is cleaned according to the data operation record of the at least one substructure.
[0053] In the disclosed embodiment, the database can be cleaned according to the state information and data operation record of at least one substructure. For example, the data operation record of the substructure whose state information is that the operation has been executed without error and that the operation has been executed with error can be determined as the operation record to be rolled back, and the database can be cleaned according to the operation record to be rolled back. When the database is cleaned according to the operation record to be rolled back, the data can be operated inversely to the operation record to be rolled back to achieve the cleaning operation of the database.
[0054] According to the program data processing method provided by the embodiment of the present disclosure, the target program is analyzed to obtain the substructure, and the status information and data operation records of the substructure are recorded, so that the target program can be finely monitored. When the status information of the target substructure is in an alarm state, the database can be automatically cleaned according to the data operation record to restore the program running environment to its initial state. The technical solution of the present disclosure can monitor the target program, and when dirty data is generated, it can automatically roll back and restore the tampered data in a timely manner, thereby reducing the impact of abnormalities such as abnormal errors and dirty data on online business.
[0055] Figure 3 The flowchart of a method for processing program data according to an exemplary embodiment is shown. The method 30 for processing program data provided by the embodiment of the present disclosure may include steps S302 to S306.
[0056] like Figure 3 As shown, in step S302, alarm information is generated according to the target substructure.
[0057] In step S304, after receiving the repair feedback in response to the alarm information, the input data of the target program and the repaired target program are obtained.
[0058] In the disclosed embodiment, an alarm message may be sent to a target object. The target object may be, for example, a target device that has performed associated operations with the target program. The user of the target device may be, for example, a staff member who maintains the target program. For example, after the staff member learns of the alarm message through the target device, he or she checks the target substructure where an error occurs and maintains it according to the alarm message. Repair feedback in response to the alarm message may be sent by the target device. For example, the target device may generate the repair feedback information based on the operation of the user of the target device. The user (staff member) of the target device may operate the target device after the maintenance of the target substructure is completed, so as to generate and send repair feedback in response to the alarm message through the target device.
[0059] The input data of the target program may be pre-stored in a data operation record or in a storage medium. The repaired target program may be obtained according to the repair feedback.
[0060] In step S306, the repaired target program is executed based on the input data to obtain a processing result.
[0061] According to the program data processing method provided by the embodiment of the present disclosure, an alarm message can be generated in time when an error occurs in the target program. After obtaining the repair feedback, the repaired target program is re-executed according to the input data of the pre-stored target program, thereby avoiding the loss of real online business caused by the inability to reproduce the previous alarm problem due to the change of input data in the scheduled task.
[0062] Figure 4 The flowchart of a method for processing program data according to an exemplary embodiment is shown. The method 40 for processing program data provided by the embodiment of the present disclosure may include steps S402 to S406.
[0063] Steps S402 to S406 of the embodiment of the present disclosure may serve as replacement steps for step S206.
[0064] In step S402, if the substructure includes a new operation, the data of the new operation is stored in the data operation record with a first identifier.
[0065] In the disclosed embodiment, the first identifier is used to mark the specific operation type of the newly added operation data in the target program. The newly added operation data is the newly added specific data. For example, the first identifier can be used as a key and the newly added operation data can be used as a value to store in a key-value database. The first identifier can also be used as an attribute and the newly added operation data can be used as an attribute value to store in a database table.
[0066] In step S404, if the substructure includes a deletion operation, the data of the deletion operation is stored in the data operation record with a second identifier.
[0067] In the embodiment of the present disclosure, the second identifier is used to mark the specific operation type of the data of the deletion operation in the target program. The data of the deletion operation is the specific data to be deleted.
[0068] In step S406, if the substructure includes an update operation, the initial data and the update data of the update operation are stored in the data operation record with a third identifier.
[0069] In the embodiment of the present disclosure, the third identifier is used to mark the specific operation type of the initial data and the update data of the update operation. The initial data of the update operation is the data before the update, and the update data of the update operation is the data after the update.
[0070] In an exemplary embodiment, the input data of the target program can also be obtained and stored in the data operation record, so that after receiving the repair feedback in response to the alarm information, the repaired target program can be re-executed according to the input data of the target program to avoid the situation where the previous problem cannot be reproduced due to the change of input data, thereby ensuring the normal execution of real online business.
[0071] According to the program data processing method provided by the embodiment of the present disclosure, the codes in the substructure are screened and classified to obtain the new operation, deletion operation, and update operation in the substructure, and the new operation, deletion operation, and update operation are stored as data operation records according to the first identifier, the second identifier, and the third identifier, respectively, so as to facilitate the automatic rollback of the database when the target substructure with status information in the substructure is in an alarm state, thereby cleaning the database.
[0072] Figure 5 The flowchart of a method for processing program data according to an exemplary embodiment is shown. The method 50 for processing program data provided by the embodiment of the present disclosure may include steps S502 to S506.
[0073] Steps S502 to S506 of the embodiment of the present disclosure may serve as replacement steps for step S208.
[0074] In step S502, if the data operation record includes data with the first identifier, the data with the first identifier is deleted from the database.
[0075] In the disclosed embodiment, since the data with the first identifier is the data newly added to the database during the execution of the target program, by deleting the data with the first identifier from the database, the new operation on the database during the execution of the target program can be rolled back to achieve data cleaning.
[0076] In step S504, if the data operation record includes data with the second identifier, the data with the second identifier is newly added to the database.
[0077] In the disclosed embodiment, since the data with the second identifier is data deleted from the database during the target program execution, by adding the data with the second identifier to the database, the deletion operation on the database during the target program execution can be rolled back to achieve data cleaning.
[0078] In step S506, if the data operation record includes data with the third identifier, the update data in the database is updated according to the initial data with the third identifier.
[0079] In the disclosed embodiment, since the data with the third identifier includes the initial data and the updated data updated from the database during the execution of the target program, by updating the updated data in the database with the initial data, the update operation on the database during the execution of the target program can be rolled back to achieve data cleaning.
[0080] Figure 6 FIG. 1 is a flowchart of a method for processing program data according to an exemplary embodiment. Figure 6 As shown, the program data processing method 60 provided in the embodiment of the present disclosure may include steps S602 to S606.
[0081] In step S602, a hierarchical relationship between at least one substructure is determined.
[0082] In the embodiments of the present disclosure, for example, the target program may be instrumented, and the instrumented code may be subjected to lexical and grammatical analysis to obtain the program control flow relationship, and then obtain the hierarchical relationship of the target program. The hierarchical relationship may include, for example, a loop structure, a decision structure, an assignment structure, a call structure, etc. The loop structure may include, for example, the following loop statements: for, while, dowhile, etc. The decision structure may include, for example, the following decision statements: if, else, else if, switch, case, break, etc.
[0083] In step S604, at least one substructure is organized into a tree-like hierarchical diagram according to the hierarchical relationship.
[0084] In an exemplary embodiment, if the hierarchical relationship includes a loop structure, the substructure corresponding to the loop structure is determined as a parallel branch. Among them, the loop structure can be divided into two substructures, one that enters the loop body and one that does not enter the loop body. The substructure that enters the loop body and the substructure that does not enter the loop body can be determined as parallel branches. If the hierarchical relationship includes a determination structure, the substructure corresponding to the determination structure is determined as a parallel branch. Among them, the determination structure can be divided into two substructures that meet the determination condition and do not meet the determination condition according to whether the determination condition is met. The substructure that meets the determination condition and the substructure that does not meet the determination condition can be determined as parallel branches. If the hierarchical relationship includes an assignment structure, the substructure corresponding to the assignment structure is determined as a series branch. If the hierarchical relationship includes a call structure, the substructure corresponding to the call structure is determined as a series branch; at least one substructure is organized into a tree-shaped hierarchical graph according to the parallel branches and the series branches.
[0085] In step S606, a tree-like hierarchy diagram is displayed on a display screen.
[0086] In the disclosed embodiment, the substructure in the tree hierarchy diagram may be displayed in the form of a block diagram.
[0087] In an exemplary embodiment, the color identification of the substructure in the tree hierarchy diagram can be determined according to the status information of at least one substructure; and the tree hierarchy diagram can be displayed on the display screen according to the color identification of at least one substructure. Different status information may correspond to corresponding color identifications. For example, the color identification corresponding to the status information of the unexecuted state may be, for example, gray; the color identification corresponding to the status information of the executed and non-error state may be, for example, green; the color identification corresponding to the status information of the executed and error state (alarm state) may be, for example, red. However, the above-mentioned specific color identifications are only examples, and the technical solution of the present disclosure does not specifically limit this.
[0088] In an exemplary embodiment, a "turn on automatic rollback" button may be provided on the display screen, and the aforementioned operation may be started based on the user clicking the "turn on automatic rollback" button. Figure 2 , Figure 3 , Figure 4 , Figure 5 The above steps are completed based on the user clicking the "Start Auto Rollback" button again. Figure 2 , Figure 3 , Figure 4 , Figure 5 steps.
[0089] In an exemplary embodiment, a "reset" button may also be provided on the display screen. Steps S304 to S306 as described above are implemented based on the user clicking the "reset" button.
[0090] According to the program data processing method provided by the embodiment of the present disclosure, by determining the hierarchical relationship between substructures and constructing a tree-shaped hierarchical diagram based on the hierarchical relationship, the tree-shaped hierarchical diagram can be displayed on a display screen, thereby realizing visual monitoring and recording of the execution trajectory of the target program. This facilitates maintenance personnel to visually observe the execution status of the target program through the block diagram, thereby improving user experience.
[0091] Figure 7 FIG. 1 is a flowchart of a method for processing program data according to another exemplary embodiment. Figure 7 As shown, the program data processing method of the embodiment of the present disclosure may include steps S702 to S708. The interface diagram of the display screen including buttons involved in the embodiment of the present disclosure may be as shown in FIG. Fig.10 shown. Fig.10 The interface diagram includes a tree-level diagram of scheduled tasks, as well as an "Enable automatic rollback" button and a "Reset" button.
[0092] In step S702, it is determined whether automatic rollback is enabled. If so, step S704 is executed, otherwise the process ends.
[0093] In the embodiment of the present disclosure, whether automatic rollback is enabled can be set by the user clicking Fig.10 Click the "Turn on automatic rollback" button in the interface shown to make settings.
[0094] In step S704, the target program is analyzed to obtain at least one substructure in the target program and state information of at least one substructure during execution; the substructure and the state information of the substructure are organized into a tree-like hierarchical diagram.
[0095] In step S706, a data operation record of at least one substructure is obtained.
[0096] In step S708, if at least one substructure has a target substructure whose status information is an alarm status, the database is cleaned according to the data operation records of the substructure.
[0097] In step S710, alarm information is generated according to the target substructure.
[0098] In step S712, after receiving the reset information of the "Reset" button, the input data of the target program and the repaired target program are obtained.
[0099] In the disclosed embodiment, the reset information of the “reset” button can be generated by the relevant maintenance personnel after completing the code maintenance of the target substructure.
[0100] In step S714, the repaired target program is executed based on the input data, and the process returns to step S702 to obtain a processing result.
[0101] In the disclosed embodiment, after the abnormal error problem is repaired, after receiving the re-information, the repaired target program can be re-executed based on the original input data of the target program, thereby minimizing the impact of abnormalities such as abnormal errors and dirty data on online business.
[0102] Figure 8 FIG. 1 is a flowchart of a method for processing program data according to another exemplary embodiment. Figure 8 As shown, Figure 7 Step S704 in the illustrated embodiment may further include the following steps.
[0103] In step S802, the execution entry of the target program is found through the timer configuration.
[0104] In step S804, a hierarchical relationship between at least one substructure is determined; and at least one substructure is organized into a tree-shaped hierarchical diagram according to the hierarchical relationship.
[0105] In step S806, the coordinate value of each substructure is determined according to the preset window size and the drawing starting point.
[0106] In step S808, the tree hierarchy diagram is displayed on a display screen according to the coordinate values of the substructures.
[0107] In step S810, a tracking point is inserted into the execution entry of the target program.
[0108] In step S812, a tracking point is inserted into the interface or method called by the target program.
[0109] In step S814, status information of at least one substructure is obtained.
[0110] In step S816, if the status information is an unexecuted state, a block diagram corresponding to the substructure is displayed on the display screen according to the color mark (eg, gray) of the unexecuted state.
[0111] In step S818, if the status information is an executed and no error status, a block diagram corresponding to the substructure is displayed on the display screen according to the color identification (eg, green) of the executed and no error status.
[0112] In step S820, if the status information is an executed and error state (alarm state), the block diagram corresponding to the substructure is displayed on the display screen according to the color mark (for example, red) of the executed and error state. Fig.10 No specific information about the color codes is shown.
[0113] The program data processing method provided by the embodiment of the present disclosure analyzes the target program, obtains at least one substructure and displays the execution trajectory of the target program on a display screen according to the hierarchical relationship and status information between the substructures, so as to realize visual and traceable monitoring of the whole process execution trajectory of the target program. By displaying the execution process of the target program on the display screen in a more intuitive and structured manner, the target program can be monitored and analyzed in real time, which facilitates users to locate the code execution status.
[0114] Fig. 9 FIG. 1 is a flowchart of a method for processing program data according to another exemplary embodiment. Fig. 9 As shown, Figure 7 Step S708 in the illustrated embodiment may further include the following steps.
[0115] In step S902, it is determined whether the database is modified during the execution of the target program; if so, step S904 is executed, otherwise the process ends after obtaining the input data of the target program.
[0116] In step S904, data operation records are obtained, and each operation record in the data operation records is cyclically judged to clean the database data.
[0117] In step S906, if the loop ends, the process ends, otherwise it returns to step S904.
[0118] Wherein, step S904 may further include the following steps:
[0119] In step S9041, if the data operation record includes data with a first identifier, the data with the first identifier is deleted from the database, wherein the data with the first identifier is data newly added to the database during the execution of the target program.
[0120] In step S9042, if the data operation record includes data with a second identifier, the data with the second identifier is newly added to the database, wherein the data with the second identifier is data deleted from the database during the execution of the target program.
[0121] In step S9043, if the data operation record includes data with a third identifier, the updated data in the database is updated according to the initial data with the third identifier, wherein the data with the third identifier is the initial data and updated data updated from the database during the execution of the target program.
[0122] The program data processing method provided by the embodiment of the present disclosure can automatically roll back the database data according to the data operation record at the first time when there is a target substructure in an alarm state in the substructure, so as to restore the tampered data and reduce the operation of manually repairing the data.
[0123] It should be clearly understood that the present disclosure describes how to form and use specific examples, but the principles of the present disclosure are not limited to any details of these examples. On the contrary, based on the teachings of the contents disclosed in the present disclosure, these principles can be applied to many other embodiments.
[0124] Those skilled in the art will appreciate that all or part of the steps for implementing the above embodiments are implemented as a computer program executed by a central processing unit (CPU). When the computer program is executed by the central processing unit (CPU), the above functions defined by the above method provided by the present disclosure are executed. The program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk or an optical disk, etc.
[0125] In addition, it should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above 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.
[0126] The following are embodiments of the device disclosed herein, which can be used to execute the method embodiments disclosed herein. For details not disclosed in the device embodiments disclosed herein, please refer to the method embodiments disclosed herein.
[0127] Fig.11 FIG. 1 is a block diagram of a charging device for a mobile object according to an exemplary embodiment. Fig.11 The program data processing device 1100 provided in the embodiment of the present disclosure may include: a program acquisition module 1102 , a program analysis module 1104 , an operation recording module 1106 and a data cleaning module 1108 .
[0128] In the program data processing apparatus 1100 , the program acquisition module 1102 may be configured to acquire a target program.
[0129] The program analysis module 1104 may be configured to analyze the target program to obtain at least one substructure in the target program and state information of at least one substructure during execution.
[0130] The operation record module 1106 may be configured to obtain a data operation record of at least one substructure.
[0131] The data cleaning module 1108 may be configured to clean the database according to the data operation record of at least one substructure if at least one substructure has a target substructure whose status information is an alarm status.
[0132] In an exemplary embodiment, the program data processing device 1100 may further include an alarm information module, a feedback receiving module, and a program execution module. The alarm information module may be configured to generate an alarm message according to the target substructure. The feedback receiving module may be configured to obtain input data of the target program and the repaired target program after receiving the repair feedback in response to the alarm message. The program execution module may be configured to execute the repaired target program based on the input data to obtain a processing result.
[0133] In an exemplary embodiment, the operation recording module 1106 may include a first recording unit, a second recording unit, and a third recording unit. The first recording unit may be configured to store the data of the new operation with a first identifier in the data operation record if the substructure includes a new operation. The second recording unit may be configured to store the data of the delete operation with a second identifier in the data operation record if the substructure includes a delete operation. The third recording unit may be configured to store the initial data and the update data of the update operation with a third identifier in the data operation record if the substructure includes an update operation.
[0134] In an exemplary embodiment, the data cleaning module 1108 may include a first cleaning unit, a second cleaning unit, and a third cleaning unit. The first cleaning unit may be configured to delete the data with the first identification from the database if the data operation record includes data with the first identification. The second cleaning unit may be configured to add the data with the second identification to the database if the data operation record includes data with the second identification. The third cleaning unit may be configured to update the updated data in the database according to the initial data of the third identification if the data operation record includes data with the third identification.
[0135] In an exemplary embodiment, the program data processing device 1100 may further include a hierarchical relationship module, a hierarchical graph module, and a graphic display module. The hierarchical relationship module may be configured to determine the hierarchical relationship between at least one substructure. The hierarchical graph module may be configured to organize at least one substructure into a tree-shaped hierarchical graph according to the hierarchical relationship. The graphic display module may be configured to display the tree-shaped hierarchical graph on a display screen.
[0136] In an exemplary embodiment, the graphic display module may include a color identification unit and a graphic display unit. The color identification unit may be configured to determine the color identification of the substructure in the tree hierarchy diagram according to the state information of at least one substructure. The graphic display unit may be configured to display the tree hierarchy diagram on the display screen according to the color identification of at least one substructure.
[0137] In an exemplary embodiment, the hierarchical diagram module may include a parallel structure unit, a serial structure unit, and a hierarchical assembly unit. Among them, the parallel structure unit may be configured to, if the hierarchical relationship includes a loop structure, determine the substructure corresponding to the loop structure as a parallel branch; if the hierarchical relationship includes a determination structure, determine the substructure corresponding to the determination structure as a parallel branch. The serial structure unit may be configured to, if the hierarchical relationship includes an assignment structure, determine the substructure corresponding to the assignment structure as a serial branch; if the hierarchical relationship includes a call structure, determine the substructure corresponding to the call structure as a serial branch. The hierarchical assembly unit may be configured to assemble at least one substructure into a tree-shaped hierarchical diagram according to the parallel branches and the serial branches.
[0138] According to the program data processing device provided by the embodiment of the present disclosure, the target program is analyzed to obtain the substructure, and the status information and data operation records of the substructure are recorded, so that the target program can be finely monitored. When the status information of the target substructure is in an alarm state, the database can be automatically cleaned according to the data operation record to restore the program running environment to its initial state. The technical solution of the present disclosure can monitor the target program, and when dirty data is generated, it can automatically roll back and restore the tampered data in a timely manner, thereby reducing the impact of abnormalities such as abnormal errors and dirty data on online business.
[0139] Fig.12 It is a block diagram of an electronic device according to an exemplary embodiment.
[0140] Refer to the following Fig.12 The electronic device 200 according to this embodiment of the present disclosure is described. Fig.12 The electronic device 200 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0141] like Fig.12 As shown, the electronic device 200 is in the form of a general computing device. The components of the electronic device 200 may include, but are not limited to: at least one processing unit 210, at least one storage unit 220, a bus 230 connecting different system components (including the storage unit 220 and the processing unit 210), a display unit 240, etc.
[0142] The storage unit stores program codes, which can be executed by the processing unit 210, so that the processing unit 210 executes the steps according to various exemplary embodiments of the present disclosure described in the electronic prescription circulation processing method section of this specification. For example, the processing unit 210 can execute the following steps: Figure 2 , Figure 3 , Figure 4 , Figure 5 , Figure 6 , Figure 7 , Figure 8 , Fig. 9 Follow the steps shown in .
[0143] The storage unit 220 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 2201 and / or a cache memory unit 2202 , and may further include a read-only memory unit (ROM) 2203 .
[0144] The storage unit 220 may also include a program / utility 2204 having a set (at least one) of program modules 2205, such program modules 2205 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 the implementation of a network environment.
[0145] Bus 230 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.
[0146] The electronic device 200 may also communicate with one or more external devices 300 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 200, and / or communicate with any device that enables the electronic device 200 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 250. Furthermore, the electronic device 200 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 260. The network adapter 260 may communicate with other modules of the electronic device 200 via the bus 230. 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 200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0147] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure 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, including several instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above method according to the implementation of the present disclosure.
[0148] Fig.13 A schematic diagram of a computer-readable storage medium in an exemplary embodiment of the present disclosure is schematically shown.
[0149] refer to Fig.13 As shown, a program product 400 for implementing the above method according to an embodiment of the present disclosure 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 disclosure 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.
[0150] 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.
[0151] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0152] Program code for performing the operations of the present disclosure 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 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. In cases involving a remote computing device, the remote computing device may be connected to the user 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).
[0153] The computer-readable medium carries one or more programs. When the one or more programs are executed by a device, the computer-readable medium implements the following functions: obtaining a target program; analyzing the target program to obtain at least one substructure in the target program and status information of at least one substructure during execution; obtaining a data operation record of at least one substructure; if at least one substructure has a target substructure whose status information is an alarm state, cleaning the database according to the data operation record of at least one substructure.
[0154] Those skilled in the art will appreciate that the above modules can be distributed in the device according to the description of the embodiment, or can be changed accordingly and only used in one or more devices different from the embodiment. The modules of the above embodiments can be combined into one module, or further divided into multiple sub-modules.
[0155] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure 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 embodiment of the present disclosure.
[0156] The exemplary embodiments of the present disclosure are specifically shown and described above. It should be understood that the present disclosure is not limited to the detailed structures, configurations or implementations described herein; on the contrary, the present disclosure is intended to cover various modifications and equivalent configurations included in the spirit and scope of the appended claims.
Claims
1. A program data processing method, characterized in that: include: Get the target program; Analyzing the target program to obtain at least one substructure in the target program and state information of at least one substructure during execution; obtaining a data operation record of at least one of the substructures; If at least one of the substructures has a target substructure whose status information is in an alarm state, cleaning the database according to the data operation record of at least one of the substructures; Wherein, the method further comprises: determining a hierarchical relationship between at least one of the substructures; According to the hierarchical relationship, at least one of the substructures is organized into a tree-shaped hierarchical diagram; Displaying the tree-like hierarchical diagram on a display screen; The step of organizing at least one of the substructures into a tree-shaped hierarchical diagram according to the hierarchical relationship includes: According to the relationship statement between the substructures in the hierarchical relationship, the substructure corresponding to the relationship statement is determined as a parallel branch or a series branch; the relationship statement includes at least one of a loop statement, a determination statement, an assignment statement and a call statement; At least one of the substructures is organized into the tree-like hierarchical graph according to the parallel branches and / or the serial branches.
2. The method according to claim 1, characterized in that Also includes: generating alarm information according to the target substructure; After receiving the repair feedback in response to the alarm information, acquiring the input data of the target program and the repaired target program; The repaired target program is executed based on the input data to obtain a processing result.
3. The method according to claim 1, characterized in that Obtaining a data operation record of at least one of the substructures comprises: If the substructure includes a new operation, storing data of the new operation in the data operation record with a first identifier; If the substructure includes a deletion operation, storing the data of the deletion operation in the data operation record with a second identifier; If the substructure includes an update operation, the initial data and the update data of the update operation are stored in the data operation record with a third identifier.
4. The method according to claim 3, characterized in that Cleaning the database data according to the data operation record of the target substructure includes: If the data operation record includes data with a first identifier, deleting the data with the first identifier from the database; If the data operation record includes data with a second identifier, the data with the second identifier is newly added into the database; If the data operation record includes data with a third identifier, the update data in the database is updated according to the initial data with the third identifier.
5. The method according to claim 1, characterized in that Displaying the tree-like hierarchical diagram on a display screen includes: Determine a color identification of the substructure in the tree hierarchy diagram according to the state information of at least one of the substructures; The tree-like hierarchical diagram is displayed on a display screen according to the color identification of at least one of the substructures.
6. The method according to claim 1, characterized in that According to the relationship statement between the substructures in the hierarchical relationship, determining the substructure corresponding to the relationship statement as a parallel branch or a series branch includes: If the hierarchical relationship includes a loop structure, determining the substructure corresponding to the loop structure as a parallel branch; If the hierarchical relationship includes a determination structure, determining the substructure corresponding to the determination structure as a parallel branch; If the hierarchical relationship includes an assignment structure, determining the substructure corresponding to the assignment structure as a series branch; If the hierarchical relationship includes a call structure, the substructure corresponding to the call structure is determined as a series branch.
7. A program data processing device, characterized in that: include: A program acquisition module, configured to acquire a target program; A program analysis module, configured to analyze the target program to obtain at least one substructure in the target program and state information of at least one substructure during execution; an operation record module, configured to obtain a data operation record of at least one of the substructures; a data cleaning module configured to clean the database according to the data operation record of at least one of the substructures if at least one of the substructures has a target substructure with status information in an alarm state; a hierarchical relationship module, configured to determine a hierarchical relationship between at least one of the substructures; A hierarchical diagram module, configured to organize at least one of the substructures into a tree-shaped hierarchical diagram according to the hierarchical relationship; A graphic display module, configured to display the tree-like hierarchical diagram on a display screen; Wherein, the hierarchical graph module is configured to determine the substructure corresponding to the relational statement as a parallel branch or a serial branch according to the relational statement between the substructures in the hierarchical relationship; The relational statements include at least one of loop statements, determination statements, assignment statements and call statements; at least one of the substructures is organized into the tree-like hierarchical graph according to the parallel branches and / or the series branches.
8. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
9. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Primary subcommand rollback method and terminal
CN102111783A
