A method, system, device and medium for operating memory data

By using dynamic proxy objects to backup and roll back memory data in the Spring framework, it solves the possible disorder problems in memory data operations and improves the security and stability of data processing.

CN113608725BActive Publication Date: 2025-04-18JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110807531.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-16
Publication Date
2025-04-18
Estimated Expiration
2041-07-16

AI Technical Summary

Technical Problem

When using the Spring framework, the deletion and addition of memory data may cause data disorder, especially in exceptional situations, which may cause business logic problems.

Method used

Add annotations on memory variables, classes or methods that need to be operated, and create dynamic proxy objects based on these annotations. Back up and roll back memory data through dynamic proxy objects to ensure the security and stability of data operations.

Benefits of technology

Through the use of dynamic proxy objects, the disorder of memory data is avoided, the security and stability of data processing are increased, and the integrity of business logic is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113608725B_ABST
    Figure CN113608725B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system, device and storage medium for operating memory data, the method comprising: adding annotations to memory variables, classes or methods to be operated, and indicating the variable name of the memory data in the annotations of the memory variables; creating a dynamic proxy object based on the annotated memory variables, classes or methods, and backing up the memory data according to the variable name based on the dynamic proxy object; determining a target method according to the annotated class or method, executing the target method based on the dynamic proxy object, and judging whether an exception occurs during the execution process; and in response to an exception during the execution process, re-executing the target method using the backed-up memory data. The present invention can avoid the phenomenon of disorder in processing memory data by adding annotations and creating a dynamic proxy object based on the annotated memory variables, classes or methods, thereby increasing the stability of the program.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and more specifically, to a method, system, computer device and readable medium for operating memory data. Background Art

[0002] The Spring Framework was created due to the complexity of software development. Spring uses basic JavaBeans to accomplish things that were previously only possible with EJB (Enterprise Java Bean, a commercial application component technology in JAVA). However, Spring's use is not limited to server-side development. From the perspective of simplicity, testability, and loose coupling, most Java applications can benefit from Spring.

[0003] Currently, when using the spring framework, in a code block, when deleting or adding memory data, the data will be directly deleted and added. If an exception occurs when executing a certain line in the code block, the code after that line will usually not be executed sequentially. At this time, some data may have been added or deleted in the memory, and dependent data needs to be added or deleted in other memories. In such a scenario, it is relatively troublesome to solve this problem. For example: there are two sets A and B in the memory. A certain data stored in A has a certain dependency relationship with the data stored in B. When data is added or deleted in A, there must be a corresponding addition or deletion in B. If there is a problem with the code after A adds or deletes data and before the corresponding addition or deletion operation is performed in B, the corresponding dependent data will not be stored in B, which may cause data disorder and, in severe cases, business logic problems. Summary of the invention

[0004] In view of this, the purpose of an embodiment of the present invention is to propose a method, system, computer device and computer-readable storage medium for operating memory data. The present invention adds annotations to memory variables, classes or methods that need to be operated, and creates dynamic proxy objects based on the annotated memory variables, classes or methods. By operating memory data through dynamic proxy objects, possible disorder of memory data can be avoided, thereby increasing the security and stability of data processing.

[0005] Based on the above purpose, one aspect of an embodiment of the present invention provides a method for operating memory data, comprising the following steps: adding annotations to a memory variable, class or method to be operated, and indicating the variable name of the memory data in the annotation of the memory variable; creating a dynamic proxy object based on the annotated memory variable, class or method, and backing up the memory data according to the variable name based on the dynamic proxy object; determining a target method based on the annotated class or method, executing the target method based on the dynamic proxy object, and determining whether an exception occurs during the execution process; and in response to an exception occurring during the execution process, re-executing the target method using the backed-up memory data.

[0006] In some implementations, creating a dynamic proxy object based on the annotated memory variable, class or method includes: generating dynamic code according to the annotated class or method, and combining the dynamic code with a common code to form a dynamic proxy object.

[0007] In some implementations, backing up the memory data based on the variable name based on the dynamic proxy object includes: converting the memory data into a json string and saving it in a string variable, or converting the memory data into a stream form.

[0008] In some implementations, re-executing the target method using the backed-up memory data includes: converting the string variable or stream form in the backed-up memory data into the original data format, and pointing the reference of the memory variable to the backed-up memory data.

[0009] In some embodiments, executing the target method based on the dynamic proxy object includes: checking whether the annotated memory variable exists in the memory based on the dynamic proxy object; and reloading the spring framework in response to the absence of the annotated memory variable in the memory.

[0010] In some embodiments, determining the target method based on the annotated class or method includes: in response to the existence of a class adding an annotation, numbering the sub-methods contained in the class in order, and determining the sub-methods as the target method in order according to the numbers.

[0011] In some implementations, re-executing the target method using the backed-up memory data includes: rolling back the memory data that has executed the target method, and storing the rolled-back data as backup data.

[0012] Another aspect of an embodiment of the present invention provides a system for operating memory data, including: an annotation module, configured to add annotations to memory variables, classes or methods to be operated, and indicate the variable name of the memory data in the annotation of the memory variable; a creation module, configured to create a dynamic proxy object based on the annotated memory variable, class or method, and back up the memory data according to the variable name based on the dynamic proxy object; an execution module, configured to determine a target method based on the annotated class or method, execute the target method based on the dynamic proxy object, and determine whether an exception occurs during the execution process; and a backup module, configured to re-execute the target method using the backed-up memory data in response to an exception occurring during the execution process.

[0013] According to another aspect of an embodiment of the present invention, a computer device is provided, comprising: at least one processor; and a memory, wherein the memory stores computer instructions executable on the processor, and the instructions implement the steps of the above method when executed by the processor.

[0014] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, which stores a computer program that implements the above method steps when executed by a processor.

[0015] The present invention has the following beneficial technical effects: adding annotations to memory variables, classes or methods that need to be operated, and creating dynamic proxy objects based on the annotated memory variables, classes or methods, and operating memory data through dynamic proxy objects can avoid possible disorder of memory data, thereby increasing the security and stability of data processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.

[0017] Figure 1 A schematic diagram of an embodiment of a method for operating memory data provided by the present invention;

[0018] Figure 2 A schematic diagram of the hardware structure of an embodiment of a computer device for operating memory data provided by the present invention;

[0019] Figure 3 A schematic diagram of an embodiment of a computer storage medium for operating memory data provided by the present invention. DETAILED DESCRIPTION

[0020] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0021] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one.

[0022] A first aspect of an embodiment of the present invention provides an embodiment of a method for operating memory data. Figure 1 FIG. 1 is a schematic diagram of an embodiment of a method for operating memory data provided by the present invention. Figure 1 As shown, the embodiment of the present invention includes the following steps:

[0023] S1. Add an annotation to the memory variable, class or method to be operated, and indicate the variable name of the memory data in the annotation of the memory variable;

[0024] S2. Creating a dynamic proxy object based on the annotated memory variable, class or method, and backing up the memory data according to the variable name based on the dynamic proxy object;

[0025] S3, determining a target method according to the annotated class or method, executing the target method based on the dynamic proxy object, and determining whether an exception occurs during the execution; and

[0026] S4. In response to an exception occurring during the execution process, the target method is re-executed using the backed-up memory data.

[0027] The present invention includes annotations (which can be understood as a kind of identification) and proxy objects. The beneficial effects of the proxy objects used in the present invention are as follows: first, dynamic loading is possible; second, repeated codes are extracted; third, the code is guaranteed to only implement business logic and is not polluted by codes other than business logic; fourth, it is simple and convenient, and annotations can be added to the memory variables, methods or classes that need to be used. When the program runs to the annotated method or class, it is actually running the method in the dynamic proxy object, and the corresponding method in the proxy object has also integrated the code other than the business code written by the programmer. In this way, the proxy object can make the memory data in all collections in the memory operate together, avoiding the possibility of data disorder in the memory, and increasing the stability of the program to a certain extent.

[0028] Add annotations to the memory variable, class or method to be operated, and indicate the variable name of the memory data in the annotation of the memory variable. For example, class A includes sub-methods a1, a2, a3 and a4. If the class needs to be operated, add annotations to class A, indicating that sub-methods a1, a2, a3 and a4 all need to be operated; if the method needs to be operated, add annotations to a1 and a2, and a3 and a4 do not need to be operated.

[0029] A dynamic proxy object is created based on the annotated memory variable, class or method, and the memory data is backed up according to the variable name based on the dynamic proxy object.

[0030] Dynamic proxy is a technology that creates a proxy object of the target object during program execution and enhances the functionality of the methods in the target object. In the process of generating the proxy object, the target object remains unchanged, and the method in the proxy object is an enhanced method of the target object method. It can be understood as the dynamic interception of the method in the object during operation, and the functional operation is performed before and after the interception method. The proxy object created by the proxy class during program execution is called a dynamic proxy object. In this case, the created proxy object is not defined in the Java code in advance. Instead, it is dynamically generated during operation according to the "instructions" in the dynamic proxy object. In other words, the dynamic proxy will dynamically generate proxy objects for different target objects. Dynamic proxy can enhance the functionality of the methods of the proxied object. With the technology of dynamic proxy, you can enhance the functionality of the methods of the proxied object without modifying the source code of the method, and do whatever you want before and after the method is executed.

[0031] In some implementations, creating a dynamic proxy object based on the annotated memory variable, class or method includes: generating dynamic code according to the annotated class or method, and combining the dynamic code with a common code to form a dynamic proxy object.

[0032] In some implementations, backing up the memory data based on the variable name based on the dynamic proxy object includes: converting the memory data into a json string and saving it in a string variable, or converting the memory data into a stream form.

[0033] The target method is determined according to the annotated class or method, the target method is executed based on the dynamic proxy object, and it is determined whether an exception occurs during the execution.

[0034] In some embodiments, the determining the target method according to the annotated class or method includes: in response to the existence of the class adding annotations, numbering the sub-methods contained in the class in order, and determining the sub-methods as target methods in sequence according to the numbers. For example, class A includes sub-methods a1, a2, a3, and a4. If class A adds annotations, a1, a2, a3, and a4 can be numbered in order, and a1, a2, a3, and a4 can be determined as target methods in sequence according to the numbers.

[0035] In some implementations, executing the target method based on the dynamic proxy object includes: verifying whether the annotated memory variable exists in the memory based on the dynamic proxy object; and reloading the spring framework in response to the absence of the annotated memory variable in the memory. Before executing the target method methodA, the memory variable is verified, and the main verification content is whether the annotated memory variable exists in the memory. If the annotated memory variable does not exist, the spring framework fails to load and the spring framework can be reloaded.

[0036] In response to an exception occurring during the execution process, the target method is re-executed using the backed-up memory data.

[0037] In some implementations, re-executing the target method using the backed-up memory data includes: converting the string variable or stream form in the backed-up memory data into the original data format, and pointing the reference of the memory variable to the backed-up memory data.

[0038] In some embodiments, re-executing the target method using the backed-up memory data includes: rolling back the memory data that has executed the target method, and storing the rolled-back data as backup data. In order to avoid abnormalities occurring again during the execution process, the memory data that has executed the target method can be rolled back, and the rolled-back data can be stored as backup data.

[0039] The embodiment of the present invention utilizes the dynamic proxy method in spring to realize the submission and rollback of memory-level data operations. The embodiment of the present invention adds annotations to memory variables and classes or methods, utilizes the characteristics of dynamic proxy objects in the spring framework, dynamically generates codes and extracts the codes of the common parts, and the user can use this function simply and conveniently, and when operating memory data, the effect of operating all the data sets in the memory together can be achieved.

[0040] Code example:

[0041]

[0042]

[0043] Data1 represents the class storing memory variables; Data2 represents the class storing the target method; Data2Proxy represents the dynamic proxy class, and the internal method only roughly shows the internal structure for the purpose of better understanding the present invention. The try catch code is used to enter the catch code block when an exception occurs in the try code block;

[0044] @MemoryData indicates that the annotation is used to mark the memory variable, which supports data submission and rollback. @Memory("Data1.data") indicates that the annotation is used to mark the method, which indicates that the method or all methods in the class can submit and rollback the data in the Data1 class, and can selectively customize the partial submission and rollback of the memory data marked with @MemoryData. The content in the brackets is the variable name (can be multiple, separated by ","), and the format is: class name where the memory variable is located.memory variable name.

[0045] The embodiment of the present invention adds annotations to memory variables, classes or methods that need to be operated, and creates dynamic proxy objects based on the annotated memory variables, classes or methods. By operating memory data through the dynamic proxy objects, it is possible to avoid the disorder of memory data and increase the security and stability of data processing.

[0046] It should be pointed out in particular that the various steps in the various embodiments of the above-mentioned method for operating memory data can be cross-linked, replaced, added, and deleted. Therefore, these reasonable permutations, combinations and transformations of the method for operating memory data should also belong to the scope of protection of the present invention, and the scope of protection of the present invention should not be limited to the embodiments.

[0047] Based on the above purpose, the second aspect of an embodiment of the present invention proposes a system for operating memory data, including: an annotation module, configured to add annotations to memory variables, classes or methods to be operated, and indicate the variable name of the memory data in the annotation of the memory variable; a creation module, configured to create a dynamic proxy object based on the annotated memory variable, class or method, and back up the memory data according to the variable name based on the dynamic proxy object; an execution module, configured to determine a target method based on the annotated class or method, execute the target method based on the dynamic proxy object, and determine whether an exception occurs during the execution process; and a backup module, configured to re-execute the target method using the backed-up memory data in response to an exception occurring during the execution process.

[0048] In some implementations, the creation module is configured to generate dynamic code based on the annotated class or method, and combine the dynamic code with the common code to form a dynamic proxy object.

[0049] In some implementations, the creation module is configured to: convert the memory data into a json string and save it in a string variable, or convert the memory data into a stream form.

[0050] In some implementations, the backup module is configured to: convert the string variable or stream form in the backed-up memory data into the original data format, and point the reference of the memory variable to the backed-up memory data.

[0051] In some embodiments, the execution module is configured to: check whether the annotated memory variable exists in memory based on the dynamic proxy object; and reload the spring framework in response to the absence of the annotated memory variable in memory.

[0052] In some implementations, the execution module is configured to: in response to the presence of a class adding an annotation, number the sub-methods included in the class in order, and determine the sub-methods as target methods in order according to the numbers.

[0053] In some implementations, the backup module is configured to: roll back the memory data on which the target method has been executed, and store the rolled back data as backup data.

[0054] Based on the above purpose, the third aspect of an embodiment of the present invention proposes a computer device, comprising: at least one processor; and a memory, the memory storing computer instructions that can be run on the processor, the instructions being executed by the processor to implement the following steps: S1, adding annotations to the memory variables, classes or methods to be operated, and indicating the variable name of the memory data in the annotation of the memory variable; S2, creating a dynamic proxy object based on the annotated memory variables, classes or methods, and backing up the memory data according to the variable name based on the dynamic proxy object; S3, determining a target method based on the annotated class or method, executing the target method based on the dynamic proxy object, and determining whether an exception occurs during the execution process; and S4, in response to an exception occurring during the execution process, re-executing the target method using the backed-up memory data.

[0055] In some implementations, creating a dynamic proxy object based on the annotated memory variable, class or method includes: generating dynamic code according to the annotated class or method, and combining the dynamic code with a common code to form a dynamic proxy object.

[0056] In some implementations, backing up the memory data based on the variable name based on the dynamic proxy object includes: converting the memory data into a json string and saving it in a string variable, or converting the memory data into a stream form.

[0057] In some implementations, re-executing the target method using the backed-up memory data includes: converting the string variable or stream form in the backed-up memory data into the original data format, and pointing the reference of the memory variable to the backed-up memory data.

[0058] In some embodiments, executing the target method based on the dynamic proxy object includes: checking whether the annotated memory variable exists in the memory based on the dynamic proxy object; and reloading the spring framework in response to the absence of the annotated memory variable in the memory.

[0059] In some embodiments, determining the target method based on the annotated class or method includes: in response to the existence of a class adding an annotation, numbering the sub-methods contained in the class in order, and determining the sub-methods as the target method in order according to the numbers.

[0060] In some implementations, re-executing the target method using the backed-up memory data includes: rolling back the memory data that has executed the target method, and storing the rolled-back data as backup data.

[0061] like Figure 2 FIG. 1 is a schematic diagram of the hardware structure of an embodiment of the computer device for operating memory data provided by the present invention.

[0062] As Figure 2 Taking the device shown as an example, the device includes a processor 201 and a memory 202, and may also include: an input device 203 and an output device 204.

[0063] The processor 201, the memory 202, the input device 203 and the output device 204 may be connected via a bus or other means. Figure 2 The example of connecting through bus is taken in the following.

[0064] The memory 202 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the method for operating memory data in the embodiment of the present application. The processor 201 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 202, that is, the method for operating memory data in the above method embodiment is realized.

[0065] The memory 202 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created according to the use of a method for operating memory data, etc. In addition, the memory 202 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 202 may optionally include a memory remotely arranged relative to the processor 201, and these remote memories may be connected to the local module via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0066] The input device 203 can receive input information such as user name and password. The output device 204 can include display devices such as display screens.

[0067] One or more program instructions / modules corresponding to methods for operating memory data are stored in the memory 202, and when executed by the processor 201, the method for operating memory data in any of the above method embodiments is executed.

[0068] Any embodiment of a computer device that executes the above-mentioned method for operating memory data can achieve the same or similar effect as any corresponding embodiment of the above-mentioned method.

[0069] The present invention also provides a computer-readable storage medium, which stores a computer program that, when executed by a processor, performs a method for operating memory data.

[0070] like Figure 3 FIG. 1 is a schematic diagram of an embodiment of the computer storage medium for operating memory data provided by the present invention. Figure 3 Taking the computer storage medium shown as an example, the computer readable storage medium 3 stores a computer program 31 that performs a method for operating memory data when executed by a processor. A method for operating memory data includes the following steps: adding annotations to the memory variable, class or method to be operated, and indicating the variable name of the memory data in the annotation of the memory variable; creating a dynamic proxy object based on the annotated memory variable, class or method, and backing up the memory data according to the variable name based on the dynamic proxy object; determining the target method based on the annotated class or method, executing the target method based on the dynamic proxy object, and determining whether an exception occurs during the execution process; and in response to an exception occurring during the execution process, re-executing the target method using the backed-up memory data.

[0071] In some implementations, creating a dynamic proxy object based on the annotated memory variable, class or method includes: generating dynamic code according to the annotated class or method, and combining the dynamic code with a common code to form a dynamic proxy object.

[0072] In some implementations, backing up the memory data based on the variable name based on the dynamic proxy object includes: converting the memory data into a json string and saving it in a string variable, or converting the memory data into a stream form.

[0073] In some implementations, re-executing the target method using the backed-up memory data includes: converting the string variable or stream form in the backed-up memory data into the original data format, and pointing the reference of the memory variable to the backed-up memory data.

[0074] In some embodiments, executing the target method based on the dynamic proxy object includes: checking whether the annotated memory variable exists in the memory based on the dynamic proxy object; and reloading the spring framework in response to the absence of the annotated memory variable in the memory.

[0075] In some embodiments, determining the target method based on the annotated class or method includes: in response to the existence of a class adding an annotation, numbering the sub-methods contained in the class in order, and determining the sub-methods as the target method in order according to the numbers.

[0076] In some implementations, re-executing the target method using the backed-up memory data includes: rolling back the memory data that has executed the target method, and storing the rolled-back data as backup data.

[0077] Finally, it should be noted that a person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program of the method for operating memory data can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium of the program can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc. The above-mentioned computer program embodiments can achieve the same or similar effects as the corresponding above-mentioned arbitrary method embodiments.

[0078] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope disclosed in the embodiments of the present invention as defined in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless explicitly limited to the singular.

[0079] It should be understood that, as used herein, the singular forms "a", "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" refers to any and all possible combinations including one or more of the associated listed items.

[0080] The serial numbers of the embodiments disclosed in the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0081] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0082] A person skilled in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the embodiments of the present invention as above, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.

Claims

1. A method for operating memory data, characterized in that: The following steps are involved: Add an annotation to the memory variable, class or method to be operated, and indicate the variable name of the memory data in the annotation of the memory variable; Creating a dynamic proxy object based on the annotated memory variable, class or method, and backing up the memory data according to the variable name based on the dynamic proxy object; Determine a target method according to the annotated class or method, execute the target method based on the dynamic proxy object, and determine whether an exception occurs during the execution; as well as In response to an exception in the execution process, re-executing the target method using the backed-up memory data; The determining the target method according to the annotated class or method comprises: in response to the existence of the class adding the annotation, numbering the sub-methods contained in the class in order, and determining the sub-methods as the target method in order according to the numbers; The executing the target method based on the dynamic proxy object comprises: checking whether the annotated memory variable exists in the memory based on the dynamic proxy object; and in response to the absence of the annotated memory variable in the memory, reloading the spring framework.

2. The method according to claim 1, characterized in that The creating of a dynamic proxy object based on the annotated memory variable, class or method comprises: Dynamic code is generated according to the annotated class or method, and the dynamic code is combined with the common code to form a dynamic proxy object.

3. The method according to claim 1, characterized in that: The backing up of the memory data based on the variable name based on the dynamic proxy object includes: The memory data is converted into a json string and saved in a string variable, or the memory data is converted into a stream form.

4. The method according to claim 3, characterized in that The step of re-executing the target method using the backed-up memory data includes: The string variable or stream form in the backed-up memory data is converted into the original data format, and the reference of the memory variable is pointed to the backed-up memory data.

5. The method according to claim 1, characterized in that: The step of re-executing the target method using the backed-up memory data includes: The memory data that has executed the target method is rolled back, and the rolled back data is stored as backup data.

6. A system for operating memory data, characterized in that: include: An annotation module, configured to add annotations to the memory variable, class or method to be operated, and indicate the variable name of the memory data in the annotation of the memory variable; A creation module configured to create a dynamic proxy object based on the annotated memory variable, class or method, and back up the memory data according to the variable name based on the dynamic proxy object; An execution module, configured to determine a target method according to the annotated class or method, execute the target method based on the dynamic proxy object, and determine whether an exception occurs during the execution; Determining the target method according to the annotated class or method includes: in response to the existence of the class adding annotations, numbering the sub-methods contained in the class in order, and determining the sub-methods as target methods in sequence according to the numbers; executing the target method based on the dynamic proxy object includes: checking whether the annotated memory variable exists in the memory based on the dynamic proxy object; and in response to the absence of the annotated memory variable in the memory, reloading the spring framework; and The backup module is configured to re-execute the target method using the backed-up memory data in response to an exception occurring during the execution process.

7. A computer device, characterized in that: include: at least one processor; as well as A memory storing computer instructions executable on the processor, wherein the instructions, when executed by the processor, implement the steps of the method according to any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Method for realizing automatic backup of application data using AOP and Spring dependency injection

    CN109086034A

  • Log recording method, device and electronic device

    CN109240665A