Method for refreshing memory object, device, electronic equipment and storage medium

By generating an instruction table and using reflection to automatically execute the refresh strategy, the problem that existing memory object refresh methods cannot meet the requirements of low cost, low risk, and rapid effectiveness is solved, thus achieving rapid refresh of memory objects and improving operational efficiency.

CN115408306BActive Publication Date: 2026-07-10INDUSTRIAL AND COMMERCIAL BANK OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
Filing Date
2022-08-30
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing memory object refresh methods cannot simultaneously meet the production operation and maintenance requirements of low labor costs, low risk, coverage of all memory objects, and rapid effectiveness, resulting in low operation and maintenance efficiency.

Method used

By generating an instruction table, the refresh class and refresh strategy of memory objects are identified based on the changed data. The refresh strategy is then automatically executed using a reflection mechanism to achieve fast refresh of memory objects.

Benefits of technology

It enables rapid refreshing of memory objects, meeting the production and maintenance requirements of low cost, low risk, and coverage of all memory objects, thereby improving operational efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115408306B_ABST
    Figure CN115408306B_ABST
Patent Text Reader

Abstract

The application discloses a memory object refreshing method and device, an electronic device and a storage medium, and relates to the field of financial technology or other related fields, wherein the refreshing method comprises the following steps: generating an instruction table based on changed data, determining a to-be-executed instruction set based on the instruction table, traversing the to-be-executed instruction set, and in the case that the to-be-executed instruction set is not empty, obtaining a to-be-executed instruction, and executing a refreshing strategy of a refreshing class indicated by the to-be-executed instruction. The application solves the technical problem that the related art cannot meet the requirements of low cost, low risk, covering all memory objects, and quick effect in production and operation, thereby reducing the production and operation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of financial technology, and more specifically, to a method, apparatus, electronic device, and storage medium for refreshing memory objects. Background Technology

[0002] In production operations and maintenance, when production data or configurations change, it is necessary to refresh the corresponding in-memory objects on the server to ensure the latest data and configurations take effect. Two refresh methods are available in relevant technologies:

[0003] (1) Wait for the refresh thread for memory objects in the server to execute periodically. However, the execution frequency of the thread corresponding to memory objects with high change frequency is often set higher, while the execution frequency of the thread corresponding to memory objects with low change frequency is often set lower. Therefore, when data or configurations with low change frequency are changed, this method is difficult to quickly refresh the memory objects in the server, and the changes are difficult to take effect quickly.

[0004] (2) The maintenance personnel use refresh tools to manually trigger the execution of the refresh thread of the corresponding memory object in the server. Although this method can quickly refresh the memory object of the server, it increases the manual cost. When there is a lot of content to refresh, the manual time consumption and the risk of misoperation increase significantly.

[0005] Therefore, the memory object refresh methods in related technologies cannot simultaneously meet the production and maintenance requirements of low labor costs, low risk, coverage of all memory objects, and rapid effectiveness.

[0006] There is currently no effective solution to the above problems. Summary of the Invention

[0007] This invention provides a method, apparatus, electronic device, and storage medium for refreshing memory objects, in order to at least solve the technical problem in related technologies that cannot meet the requirements of low cost, low risk, coverage of all memory objects, and rapid effectiveness in production operations and maintenance, resulting in low production operation and maintenance efficiency.

[0008] According to one aspect of the present invention, a method for refreshing a memory object is provided, comprising: generating an instruction table based on change data, wherein each instruction in the instruction table corresponds to a memory object, and each instruction includes at least: a refresh class and a refresh strategy corresponding to the refresh class, the refresh strategy being used to refresh the memory object indicated by the refresh class; determining a set of instructions to be executed based on the instruction table; traversing the set of instructions to be executed, and obtaining an instruction to be executed if the set of instructions to be executed is not empty; and executing the refresh strategy of the refresh class indicated by the instruction to be executed, wherein the process of executing the refresh strategy is the process of refreshing the corresponding memory object.

[0009] Optionally, the step of generating an instruction table based on the changed data includes: obtaining the changed data from the database for which a change operation has been performed; identifying the refresh class and refresh strategy of the memory object corresponding to the changed data; generating an instruction corresponding to the memory object based on the refresh class and refresh strategy of the memory object, and inserting it into the instruction table, wherein each instruction in the instruction table further includes: instruction identifier, expiration time, and server type.

[0010] Optionally, the step of determining the set of instructions to be executed based on the instruction table includes: obtaining a first instruction set from the instruction table based on the expiration time of each instruction; determining the type and address of the current server; deleting instructions whose server type is inconsistent with the type of the current server from the first instruction set based on the server type carried by each instruction, thereby obtaining a second instruction set; traversing the execution results in the result table, and determining, based on the address of the current server and the instruction identifier of the instruction, instructions from the second instruction set that are inconsistent with both the instruction identifier carried by the execution result and the server address, thereby obtaining the set of instructions to be executed.

[0011] Optionally, if the set of instructions to be executed is not empty, after obtaining an instruction to be executed, the method further includes: obtaining the refresh class and refresh strategy of the instruction to be executed; checking whether the refresh class path indicated by the refresh class and the refresh strategy are complete, and obtaining a check result; if the check result indicates that the check has passed, executing the instruction to be executed; if the check result indicates that the check has failed, continuing to traverse the next instruction to be executed in the set of instructions to be executed.

[0012] Optionally, the step of executing the refresh strategy of the refresh class indicated by the instruction to be executed includes: in the program running state, using a preset reflection mechanism to call the refresh strategy of the refresh class indicated by the instruction to be executed; using the current server to execute the refresh strategy and obtain the execution result.

[0013] Optionally, after executing the refresh strategy and obtaining the execution result, the method further includes: recording the execution result in a result table, wherein the execution result includes at least: result identifier, instruction identifier, server address, execution time, and execution result status.

[0014] Optionally, it further includes: setting a first cleanup mechanism for the instruction table, wherein the first cleanup mechanism cleans up expired instructions in the instruction table according to a first interval period; and setting a second cleanup mechanism for the result table, wherein the second cleanup mechanism cleans up execution results in the result table whose execution time is less than a preset time threshold according to a second interval period.

[0015] According to another aspect of the present invention, a memory object refresh apparatus is also provided, comprising: a generation unit, configured to generate an instruction table based on change data, wherein each instruction in the instruction table corresponds to a memory object, and each instruction includes at least: a refresh class and a refresh strategy corresponding to the refresh class, the refresh strategy being used to refresh the memory object indicated by the refresh class; a determination unit, configured to determine a set of instructions to be executed based on the instruction table; a traversal unit, configured to traverse the set of instructions to be executed, and, if the set of instructions to be executed is not empty, obtain an instruction to be executed; and an execution unit, configured to execute the refresh strategy of the refresh class indicated by the instruction to be executed, wherein the process of executing the refresh strategy is the process of refreshing the corresponding memory object.

[0016] Optionally, the generation unit includes: a first acquisition module, used to acquire the change data from the database that has undergone a change operation; a first identification module, used to identify the refresh class and refresh strategy of the memory object corresponding to the change data; and a first generation module, used to generate an instruction corresponding to the memory object based on the refresh class and refresh strategy of the memory object, and insert it into the instruction table, wherein each instruction in the instruction table further includes: instruction identifier, expiration time, and server type.

[0017] Optionally, the determining unit includes: a second acquisition module, configured to acquire a first instruction set from the instruction table based on the expiration time of each instruction; a first determining module, configured to determine the type of the current server and the address of the current server; a first deletion module, configured to delete instructions whose server type is inconsistent with the type of the current server from the first instruction set based on the server type carried by each instruction, thereby obtaining a second instruction set; and a first traversal module, configured to traverse the execution results in the result table, and based on the address of the current server and the instruction identifier of the instruction, determine from the second instruction set instructions that are inconsistent with both the instruction identifier carried by the execution result and the server address, thereby obtaining the set of instructions to be executed.

[0018] Optionally, the refresh device further includes: a third acquisition module, configured to acquire an instruction to be executed and, after acquiring an instruction to be executed, acquire the refresh class and refresh strategy of the instruction to be executed, when the set of instructions to be executed is not empty; a first checking module, configured to check whether the refresh class path indicated by the refresh class and the refresh strategy are complete, and obtain a checking result; a first execution module, configured to execute the instruction to be executed when the checking result indicates that the check has passed; and a second traversal module, configured to continue traversing the next instruction to be executed in the set of instructions to be executed when the checking result indicates that the check has failed.

[0019] Optionally, the execution unit includes: a first invocation module, configured to invoke the refresh strategy of the refresh class indicated by the instruction to be executed using a preset reflection mechanism when the program is running; and a second execution module, configured to execute the refresh strategy using the current server to obtain the execution result.

[0020] Optionally, the refresh device further includes: a first recording module, used to record the execution result in a result table after executing the refresh strategy and obtaining the execution result, wherein the execution result includes at least: result identifier, instruction identifier, server address, execution time, and execution result status.

[0021] Optionally, the refresh device further includes: a first setting module, configured to set a first cleanup mechanism for the instruction table, wherein the first cleanup mechanism is to clean up expired instructions in the instruction table according to a first interval period; and a second setting module, configured to set a second cleanup mechanism for the result table, wherein the second cleanup mechanism is to clean up execution results in the result table whose execution time is less than a preset time threshold according to a second interval period.

[0022] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the memory object refresh method described above.

[0023] According to another aspect of the present invention, an electronic device is also provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the memory object refresh method described above.

[0024] In this disclosure, an instruction table is generated based on the changed data. Based on the instruction table, a set of instructions to be executed is determined. The set of instructions to be executed is traversed, and if the set of instructions to be executed is not empty, an instruction to be executed is obtained, and the refresh strategy of the refresh class indicated by the instruction to be executed is executed. In this disclosure, changed data can be converted into instructions, an instruction table is generated, and then a set of instructions to be executed is determined. Then, the set of instructions to be executed is traversed, and the refresh strategy of the refresh class indicated by the instruction to be executed is executed in turn to refresh the memory objects corresponding to the instructions to be executed. This enables fast refresh of memory objects in the server, so that changes can take effect quickly. At the same time, it can meet the production operation and maintenance requirements of low cost, low risk, coverage of all memory objects, and fast effect, thereby improving the efficiency of production operation and maintenance. This solves the technical problem that related technologies cannot meet the requirements of low cost, low risk, coverage of all memory objects, and fast effect in production operation and maintenance, resulting in low efficiency in production operation and maintenance. Attached Figure Description

[0025] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0026] Figure 1 This is a flowchart of an optional memory object refresh method according to an embodiment of the present invention;

[0027] Figure 2 This is a flowchart of an optional generation instruction table according to an embodiment of the present invention;

[0028] Figure 3 This is a schematic diagram of an optional memory object refresh system according to an embodiment of the present invention;

[0029] Figure 4 This is a schematic diagram of the server program execution flow of an optional near real-time refresh mechanism for server memory objects according to an embodiment of the present invention;

[0030] Figure 5 This is a schematic diagram of an optional memory object refresh device according to an embodiment of the present invention;

[0031] Figure 6 This is a hardware structure block diagram of an electronic device (or mobile device) for a method of refreshing memory objects according to an embodiment of the present invention. Detailed Implementation

[0032] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0033] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0034] To facilitate understanding of the present invention by those skilled in the art, some terms or nouns involved in the various embodiments of the present invention are explained below:

[0035] Memory objects: Collections of data that reside in memory, used to store parameter configurations, business data, etc. A server can have multiple memory objects to store different data. Each memory object has a corresponding refresh class and refresh method.

[0036] Near real-time: The difference between real-time and real-time is small.

[0037] Java reflection: refers to the ability to read an object of any class during program execution and to call the object's properties and methods at will.

[0038] It should be noted that the memory object refresh method and apparatus in this disclosure can be used in the field of fintech to refresh memory objects, and can also be used in any field other than fintech to refresh memory objects. This disclosure does not limit the application field of the memory object refresh method and apparatus.

[0039] It should be noted that all information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are information and data authorized by the user or fully authorized by all parties. For example, this system has an interface with relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving consent information from the aforementioned user or organization.

[0040] The following embodiments of the present invention can be applied to various systems / applications / devices that refresh memory objects. The present invention creates a near real-time refresh mechanism for server memory objects that requires no manual operation, using techniques such as instruction tables, result tables, reflection, and timed scanning. This mechanism enables rapid refreshing of server memory objects, allowing changes to take effect quickly. Simultaneously, it meets the production and maintenance requirements of low labor costs, low risk, coverage of all memory objects, and rapid effectiveness, greatly improving production and maintenance efficiency.

[0041] The present invention will now be described in detail with reference to various embodiments.

[0042] Example 1

[0043] According to an embodiment of the present invention, an embodiment of a method for refreshing a memory object is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0044] Figure 1 This is a flowchart of an optional memory object refresh method according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:

[0045] Step S101: Based on the changed data, generate an instruction table, wherein each instruction in the instruction table corresponds to a memory object, and each instruction includes at least: a refresh class and a refresh strategy corresponding to the refresh class, wherein the refresh strategy is used to refresh the memory object indicated by the refresh class.

[0046] Step S102: Determine the set of instructions to be executed based on the instruction table.

[0047] Step S103: Traverse the set of instructions to be executed, and if the set of instructions to be executed is not empty, obtain one instruction to be executed.

[0048] Step S104: Execute the refresh strategy of the refresh class indicated by the instruction to be executed, wherein the process of executing the refresh strategy is the process of refreshing the corresponding memory object.

[0049] Through the above steps, an instruction table can be generated based on the changed data. Based on the instruction table, a set of instructions to be executed can be determined. The set of instructions to be executed is traversed, and if the set of instructions to be executed is not empty, an instruction to be executed is obtained, and the refresh strategy of the refresh class indicated by the instruction to be executed is executed. In this embodiment of the invention, changed data can be converted into instructions to generate an instruction table, and then a set of instructions to be executed can be determined. After that, the set of instructions to be executed is traversed, and the refresh strategy of the refresh class indicated by the instruction to be executed is executed in sequence to refresh the memory object corresponding to the instruction to be executed. This enables fast refresh of memory objects in the server, allowing changes to take effect quickly. At the same time, it can meet the production operation and maintenance requirements of low cost, low risk, coverage of all memory objects, and fast effect, thereby improving the efficiency of production operation and maintenance. This solves the technical problem in related technologies that cannot meet the requirements of low cost, low risk, coverage of all memory objects, and fast effect in production operation and maintenance, resulting in low efficiency in production operation and maintenance.

[0050] The embodiments of the present invention will now be described in detail with reference to the steps described above.

[0051] Step S101: Based on the changed data, generate an instruction table, wherein each instruction in the instruction table corresponds to a memory object, and each instruction includes at least: a refresh class and a refresh strategy corresponding to the refresh class, wherein the refresh strategy is used to refresh the memory object indicated by the refresh class.

[0052] Optionally, the step of generating an instruction table based on the changed data includes: obtaining the changed data from the database for which the change operation is performed; identifying the refresh class and refresh strategy of the memory object corresponding to the changed data; generating an instruction corresponding to the memory object based on the refresh class and refresh strategy of the memory object, and inserting it into the instruction table, wherein each instruction in the instruction table also includes: instruction identifier, expiration time, and server type.

[0053] In this embodiment of the invention, the data modification module can perform operations such as adding, deleting, modifying, and querying data in the database. After the data in the database is modified, the modified data can be obtained from the database. Then, the refresh class and refresh method (i.e., refresh strategy) of the memory object corresponding to the modified data can be identified. Based on the refresh class and refresh strategy of the memory object, an instruction corresponding to the memory object is generated and inserted into the instruction table. In this embodiment, the instruction table is used to store memory object refresh instructions, including: multiple instructions, each instruction corresponding to a memory object. Each instruction includes at least: a refresh class and a refresh strategy corresponding to the refresh class (the refresh strategy is used to refresh the memory object indicated by the refresh class). Each instruction also includes: an instruction identifier, an expiration time, a server type, etc. The server type is mainly to indicate which servers the instruction applies to. The server type can be expanded to multiple types according to the actual situation to control the scope of the instruction from different dimensions.

[0054] Figure 2 This is a flowchart of an optional generation instruction table according to an embodiment of the present invention, such as... Figure 2 As shown, it includes the following steps:

[0055] Step S201: Obtain the changed data from the database for which the change operation was performed;

[0056] Step S202: Identify the refresh class and refresh strategy of the memory object corresponding to the changed data;

[0057] Step S203: Based on the refresh class and refresh strategy of the memory object, generate an instruction corresponding to the memory object and insert it into the instruction table. Each instruction in the instruction table also includes: instruction identifier, expiration time, and server type.

[0058] Table 1 shows the field names and descriptions included in an optional instruction according to an embodiment of the present invention, as shown in Table 1:

[0059] Table 1

[0060]

[0061]

[0062] Table 2 is an example description of instructions in an optional instruction table according to an embodiment of the present invention, as shown in Table 2:

[0063] Table 2

[0064]

[0065] Step S102: Determine the set of instructions to be executed based on the instruction table.

[0066] Optionally, the step of determining the set of instructions to be executed based on the instruction table includes: obtaining a first set of instructions from the instruction table based on the expiration time of each instruction; determining the type and address of the current server; deleting instructions whose server type is inconsistent with the type of the current server from the first set of instructions based on the server type carried by each instruction, thereby obtaining a second set of instructions; traversing the execution results in the result table, and determining, based on the address of the current server and the instruction identifier of the instruction, instructions from the second set that are inconsistent with both the instruction identifier carried by the execution result and the server address, thereby obtaining the set of instructions to be executed.

[0067] In this embodiment of the invention, the server can be configured with a high-frequency scheduled task to periodically read a set of instructions from the instruction table that have not yet been executed by the server and are still within their effective time range. For example, when the server's background scheduled task starts, it can be set to run every 5 minutes. Specifically, a first instruction set can be obtained from the instruction table based on the expiration time of each instruction (i.e., each instruction in the first instruction set is within its effective time range). Then, the type and address of the current server can be determined. Based on the server type carried by each instruction, instructions indicating server types that are inconsistent with the current server type are deleted from the first instruction set, resulting in a second instruction set (i.e., each instruction in the second instruction set is effective for the current server). Then, the execution results in the result table are traversed, and based on the current server address and the instruction identifier of the instruction, the instructions that do not match the instruction identifier and server address carried in the execution results are determined from the second instruction set, resulting in the set of instructions to be executed (that is, each instruction in the set of instructions to be executed is within the effective time range, is effective on the current server, and the current server has not executed the instruction (that is, there are no instruction identifiers or server addresses in the result table, and all execution results are the same as the current server address and the instruction identifier of the instruction)).

[0068] Step S103: Traverse the set of instructions to be executed, and if the set of instructions to be executed is not empty, obtain one instruction to be executed.

[0069] In this embodiment of the invention, the set of instructions to be executed is traversed, and one instruction in the set of instructions to be executed is read in sequence. If the return result is empty, it indicates that the set of instructions to be executed has been traversed. Otherwise, one instruction to be executed is returned (that is, if the set of instructions to be executed is not empty, one instruction to be executed is obtained).

[0070] Optionally, if the set of instructions to be executed is not empty, after obtaining an instruction to be executed, the process further includes: obtaining the refresh class and refresh strategy of the instruction to be executed; checking whether the refresh class path and refresh strategy indicated by the refresh class are complete, and obtaining the check result; if the check result indicates that the check has passed, executing the instruction to be executed; if the check result indicates that the check has failed, continuing to traverse the next instruction to be executed in the set of instructions to be executed.

[0071] In this embodiment of the invention, the refresh class and refresh strategy of the instruction to be executed can be obtained first, and then it can be determined whether the instruction to be executed is complete (that is, check whether the refresh class path and refresh strategy indicated by the refresh class are complete, for example, check whether the refresh class path and refresh strategy are valid and conform to the programming language specification, etc.). If the check result indicates that the check is passed, the instruction to be executed is executed. If the check result indicates that the check is not passed, the next instruction to be executed in the set of instructions to be executed is traversed.

[0072] Step S104: Execute the refresh strategy of the refresh class indicated by the instruction to be executed, wherein the process of executing the refresh strategy is the process of refreshing the corresponding memory object.

[0073] Optionally, the step of executing the refresh strategy of the refresh class indicated by the instruction to be executed includes: in the program running state, using a preset reflection mechanism to call the refresh strategy of the refresh class indicated by the instruction to be executed; using the current server to execute the refresh strategy and obtain the execution result.

[0074] In this embodiment of the invention, during program execution, a preset reflection mechanism (e.g., JAVA reflection mechanism) can be used to call the refresh strategy of the refresh class indicated by the instruction to be executed, and then the current server executes the refresh strategy to refresh the corresponding memory object and obtain the execution result.

[0075] Optionally, after executing the refresh strategy and obtaining the execution result, the method further includes: recording the execution result in a result table, wherein the execution result includes at least: result identifier, instruction identifier, server address, execution time, and execution result status.

[0076] In this embodiment of the invention, the execution result of each instruction can be recorded in a result table (used to store the results of the server executing the instructions, and the result table can be used to count whether the server has executed the instructions normally). The execution result includes: result identifier, instruction identifier, server address, execution time, execution result status, etc.

[0077] Table 3 shows the field names and descriptions included in an optional execution result according to an embodiment of the present invention, as shown in Table 3:

[0078] Table 3

[0079]

[0080] Table 4 is an example of the execution results in an optional result table according to an embodiment of the present invention, as shown in Table 4:

[0081] Table 4

[0082] Result Identifier Instruction Identifier Server address Execution time Execution result status 0 220809-1 100.100.100.100 20220809173410 0 1 220809-2 100.100.101.100 20220809173510 0 2 220809-3 100.100.102.100 20220809173610 0

[0083] Optionally, it further includes: setting a first cleanup mechanism for the instruction table, wherein the first cleanup mechanism cleans up expired instructions in the instruction table according to a first interval period; and setting a second cleanup mechanism for the result table, wherein the second cleanup mechanism cleans up execution results in the result table whose execution time is less than a preset time threshold according to a second interval period.

[0084] In this embodiment of the invention, a first cleanup mechanism can be set for the instruction table to automatically clean up expired instructions at regular intervals (i.e., clean up expired instructions in the instruction table according to a first interval period); a second cleanup mechanism can also be set for the result table to automatically clean up execution results earlier than a certain date at regular intervals (i.e., clean up execution results in the result table whose execution time is less than a preset time threshold according to a second interval period).

[0085] The following describes in detail another optional implementation method.

[0086] In this embodiment, a server memory object refresh instruction table and an instruction execution result table can be added to the database. Each instruction in the instruction table includes information such as instruction identifier, refresh class and refresh strategy, expiration time, and server type. Each execution result in the result table includes information such as result identifier, instruction identifier, server address, execution time, and execution result status. Then, the server can set up a high-frequency scheduled task to periodically read the set of instructions in the instruction table that have not yet been executed by the server and are still within their effective time range. After reading the set of instructions, the server iterates through the set to read the refresh class and refresh strategy from each instruction, and uses reflection to execute the corresponding method to refresh the corresponding memory object. Afterward, the execution result of each instruction is recorded in the result table. If a server address and instruction identifier are present in the result table, it means that the server has already executed this instruction, and the server does not need to read this instruction again when the scheduled task is executed next time.

[0087] Figure 3 This is a schematic diagram of an optional memory object refresh system according to an embodiment of the present invention, such as... Figure 3As shown, it includes: a data modification module 11, a database module 12, and an application server module 13. The database module 12 includes: an instruction table module 121 and an instruction execution result table module 122. The application server module 13 includes: an instruction acquisition module 131, an instruction execution module 132, and an instruction result recording module 133.

[0088] The functions of each module are described below:

[0089] Data Change Module 11: Production Database Change Standardization Pipeline, used to perform change operations such as adding, deleting, modifying and querying data in the database. It can insert instructions into the memory object refresh instruction table (i.e., insert instructions into instruction table module 121).

[0090] Database module 12 includes instruction table module 121 and instruction execution result table module 122. Among them,

[0091] The instruction table module 121 is used to store memory object refresh instructions. In addition, the instruction table module 121 includes an automatic cleanup mechanism to periodically clean up expired instructions.

[0092] The instruction execution result table module 122 is used to store the execution results of instructions executed by the application server. In addition, the instruction execution result table module 122 also includes an automatic cleanup mechanism to periodically clean up execution results earlier than a certain date.

[0093] Application server module 13 includes an instruction acquisition module 131, an instruction execution module 132, and an instruction result recording module 133. Among them,

[0094] The instruction acquisition module 131 can periodically read instructions that are not expired and whose "instruction number and server address" are not in the instruction execution result table module 122 from the instruction table module 121, obtain the instruction set to be executed, and then hand it over to the instruction execution module 132.

[0095] The instruction execution module 132 is responsible for traversing the set of instructions to be executed, reading the refresh class path and refresh method in each instruction, calling the refresh method of this class using reflection, and passing the execution result to the instruction result recording module 133, and then continuing to execute the next instruction.

[0096] The instruction result recording module 133 is responsible for recording the current time, server address, and execution result into the instruction execution result table module 122.

[0097] Figure 4 This is a schematic diagram of the server program execution flow for an optional near real-time refresh mechanism for server memory objects according to an embodiment of the present invention, as shown below. Figure 4 As shown, it includes the following steps:

[0098] 401: Server background scheduled task started. For example, it can be set to run every 5 minutes.

[0099] 402: The instruction retrieval module retrieves the set of instructions to be executed from the database.

[0100] 403: Read one instruction from the instruction set to be executed sequentially.

[0101] 404: Check if the instruction set is empty. If it is empty, it means that the instruction set has been traversed and 409 is executed; if it is not empty, 405 is executed.

[0102] 405: Get the refresh classpath and refresh method from the command.

[0103] 406: Check if the instruction is complete, that is, check if the refresh classpath and refresh method are valid. If they are valid, continue to execute 407; otherwise, execute 403 to process the next instruction.

[0104] 407: Use reflection to execute the refresh method of the refresh class.

[0105] 408: The instruction result recording module is invoked to record the result to the database, and the 403 instruction continues to be processed for the next instruction.

[0106] 409: Mission complete.

[0107] The following is combined with Figure 2 The two use cases in this embodiment are described in detail.

[0108] Scene 1:

[0109] Assuming a server belongs to Node1 with IP address 100.100.100.100, and the server refreshes the table to insert example data from Table 2, and the current time is 20220809173400, the steps of the scheduled task executed on this server are as follows:

[0110] 401→402→403→404→405→406→407→408→403→404→409;

[0111] Assuming each execution takes 10 seconds, the execution result is the data marked as 0 in Table 4.

[0112] Scene 2:

[0113] Assuming a server belongs to Node1 and has an IP address of 100.100.100.100, and the task is to refresh and insert data into Table 5, and assuming the current time is 20220809173400, the steps for this server's scheduled task to execute are as follows:

[0114] 401→402→403→404→405→406→407→408→403→404→405→406→407→408→403→404→409;

[0115] Assuming each execution takes 10 seconds, the execution result will be the data marked as 0 or 1 in Table 6.

[0116] Table 5

[0117] Instruction Identifier Refresh Class Refresh Strategy Expiration time Server type 220809-1 com.**.Demo refreshDemoList 20220809173500 Node1 220809-2 com.**.FundTabel refreshFundTabel 20220809173500 Node1

[0118] Table 6

[0119] Result Number Instruction Number Server address Execution time Execution result 0 220809-1 100.100.100.100 20220809173410 0 1 220809-2 100.100.100.100 20220809173420 0

[0120] In this embodiment, a valid set of server addresses can also be maintained and updated promptly when server addresses change. By obtaining refresh instructions through interface notifications, the data change module identifies the refresh class and refresh method of the memory object corresponding to the changed data and can automatically call the server memory refresh interface. The refresh interface uses reflection to execute the refresh class and refresh method.

[0121] In this embodiment of the invention, a near real-time refresh mechanism for server memory objects without manual operation is created by using techniques such as instruction tables, result tables, reflection, and timed scanning. This mechanism can meet the production and maintenance requirements of low labor costs, low risk, coverage of all memory objects, and rapid effectiveness, and greatly improves production and maintenance efficiency.

[0122] The following is a detailed description with reference to another embodiment.

[0123] Example 2

[0124] The memory object refresh device provided in this embodiment includes multiple implementation units, each of which corresponds to a specific implementation step in Embodiment 1 above.

[0125] Figure 5 This is a schematic diagram of an optional memory object refresh device according to an embodiment of the present invention, such as... Figure 5 As shown, the refresh device may include: a generation unit 50, a determination unit 51, a traversal unit 52, and an execution unit 53, wherein...

[0126] The generation unit 50 is used to generate an instruction table based on the changed data. Each instruction in the instruction table corresponds to a memory object. Each instruction includes at least a refresh class and a refresh strategy corresponding to the refresh class. The refresh strategy is used to refresh the memory object indicated by the refresh class.

[0127] The determining unit 51 is used to determine the set of instructions to be executed based on the instruction table;

[0128] Traversal unit 52 is used to traverse the set of instructions to be executed, and obtain an instruction to be executed if the set of instructions to be executed is not empty;

[0129] The execution unit 53 is used to execute the refresh strategy of the refresh class indicated by the instruction to be executed, wherein the process of executing the refresh strategy is the process of refreshing the corresponding memory object.

[0130] The aforementioned refresh device can generate an instruction table based on changed data using a generation unit 50, determine a set of instructions to be executed using a determination unit 51 based on the instruction table, traverse the set of instructions to be executed using a traversal unit 52, and obtain an instruction to be executed if the set is not empty. The execution unit 53 then executes the refresh strategy of the refresh class indicated by the instruction to be executed. In this embodiment of the invention, changed data can be converted into instructions, an instruction table can be generated, and then the set of instructions to be executed can be determined. Afterwards, the set of instructions to be executed can be traversed, and the refresh strategies of the refresh class indicated by the instructions to be executed can be executed sequentially to refresh the memory objects corresponding to the instructions to be executed. This enables rapid refreshing of memory objects in the server, allowing changes to take effect quickly. Simultaneously, it meets the production operation and maintenance requirements of low cost, low risk, coverage of all memory objects, and rapid effectiveness, improving production operation and maintenance efficiency. This solves the technical problem in related technologies that cannot meet the requirements of low cost, low risk, coverage of all memory objects, and rapid effectiveness in production operation and maintenance, resulting in low production operation and maintenance efficiency.

[0131] Optionally, the generation unit includes: a first acquisition module for acquiring change data from the database for which a change operation is performed; a first identification module for identifying the refresh class and refresh strategy of the memory object corresponding to the change data; and a first generation module for generating instructions corresponding to the memory object based on the refresh class and refresh strategy of the memory object and inserting them into an instruction table, wherein each instruction in the instruction table further includes: instruction identifier, expiration time, and server type.

[0132] Optionally, the determining unit includes: a second acquisition module, used to acquire a first instruction set from an instruction table based on the expiration time of each instruction; a first determining module, used to determine the type of the current server and the address of the current server; a first deletion module, used to delete instructions whose server type is inconsistent with the type of the current server from the first instruction set based on the server type carried by each instruction, thereby obtaining a second instruction set; and a first traversal module, used to traverse the execution results in the result table, and based on the address of the current server and the instruction identifier of the instruction, to determine from the second instruction set instructions whose instruction identifier and server address are inconsistent with those carried by the execution results, thereby obtaining a set of instructions to be executed.

[0133] Optionally, the refresh device further includes: a third acquisition module, used to acquire an instruction to be executed and, after acquiring the instruction to be executed, acquire the refresh class and refresh strategy of the instruction to be executed when the set of instructions to be executed is not empty; a first checking module, used to check whether the refresh class path and refresh strategy indicated by the refresh class are complete and obtain the check result; a first execution module, used to execute the instruction to be executed when the check result indicates that the check has passed; and a second traversal module, used to continue traversing the next instruction to be executed in the set of instructions to be executed when the check result indicates that the check has failed.

[0134] Optionally, the execution unit includes: a first invocation module, used to invoke the refresh strategy of the refresh class indicated by the instruction to be executed using a preset reflection mechanism when the program is running; and a second execution module, used to execute the refresh strategy using the current server and obtain the execution result.

[0135] Optionally, the refresh device further includes: a first recording module, used to record the execution result in a result table after executing the refresh strategy and obtaining the execution result, wherein the execution result includes at least: result identifier, instruction identifier, server address, execution time, and execution result status.

[0136] Optionally, the refresh device further includes: a first setting module for setting a first cleanup mechanism for the instruction table, wherein the first cleanup mechanism is to clean up expired instructions in the instruction table according to a first interval period; and a second setting module for setting a second cleanup mechanism for the result table, wherein the second cleanup mechanism is to clean up execution results in the result table whose execution time is less than a preset time threshold according to a second interval period.

[0137] The refresh device described above may also include a processor and a memory. The generation unit 50, the determination unit 51, the traversal unit 52, the execution unit 53, etc., are all stored in the memory as program units, and the processor executes the program units stored in the memory to realize the corresponding functions.

[0138] The aforementioned processor contains a kernel, which retrieves the corresponding program unit from memory. One or more kernels can be configured, and by adjusting kernel parameters, the refresh strategy specified by the instruction to be executed can be determined.

[0139] The aforementioned memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0140] This application also provides a computer program product that, when executed on a data processing device, is suitable for executing an initialization program with the following method steps: generating an instruction table based on changed data, determining a set of instructions to be executed based on the instruction table, traversing the set of instructions to be executed, and obtaining an instruction to be executed if the set of instructions to be executed is not empty, and executing a refresh strategy of the refresh class indicated by the instruction to be executed.

[0141] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored computer program, wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute the above-described memory object refresh method.

[0142] According to another aspect of the present invention, an electronic device is also provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors cause the one or more processors to implement the memory object refresh method described above.

[0143] Figure 6 This is a hardware structure block diagram of an electronic device (or mobile device) according to an embodiment of the present invention for a method of refreshing memory objects. Figure 6 As shown, the electronic device may include one or more processors 602 (shown as 602a, 602b, ..., 602n in the figure) 602 (processor 602 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 604 for storing data. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 6 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, the electronic device may also include components that are more... Figure 6 The more or fewer components shown, or having the same Figure 6 The different configurations shown.

[0144] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0145] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0146] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0147] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0148] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0149] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0150] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for refreshing a memory object, characterized in that, include: Based on the changed data, an instruction table is generated, wherein each instruction in the instruction table corresponds to a memory object, and each instruction includes at least: a refresh class and a refresh strategy corresponding to the refresh class, wherein the refresh strategy is used to refresh the memory object indicated by the refresh class, and each instruction in the instruction table also includes: instruction identifier, expiration time, and server type. Based on the instruction table, determine the set of instructions to be executed; Iterate through the set of instructions to be executed, and if the set of instructions to be executed is not empty, obtain one instruction to be executed; Execute the refresh strategy of the refresh class indicated by the instruction to be executed, wherein the process of executing the refresh strategy is the process of refreshing the corresponding memory object; The step of determining the set of instructions to be executed based on the instruction table includes: Based on the expiration time of each instruction, a first set of instructions is obtained from the instruction table; Determine the type and address of the current server; Based on the server type carried by each instruction, instructions indicating server types that are inconsistent with the current server type are deleted from the first instruction set to obtain a second instruction set. The execution results in the result table are traversed, and based on the current server address and the instruction identifier of the instruction, the instructions that do not match the instruction identifier and server address carried by the execution results are determined from the second instruction set, thus obtaining the set of instructions to be executed.

2. The refresh method according to claim 1, characterized in that, The steps for generating an instruction table based on the changed data include: Retrieve the changed data from the database that has been modified. Identify the refresh class and refresh strategy of the memory object corresponding to the changed data; Based on the refresh class and refresh strategy of the memory object, an instruction corresponding to the memory object is generated and inserted into the instruction table.

3. The refresh method according to claim 1, characterized in that, If the set of instructions to be executed is not empty, after obtaining one instruction to be executed, the process further includes: Obtain the refresh class and refresh strategy of the instruction to be executed; Check whether the refresh class path indicated by the refresh class and the refresh strategy are complete, and obtain the check results; If the inspection result indicates that the inspection has passed, the instruction to be executed shall be executed; If the check result indicates that the check fails, continue to traverse the next instruction to be executed in the set of instructions to be executed.

4. The refresh method according to claim 1, characterized in that, The step of executing the refresh policy of the refresh class indicated by the instruction to be executed includes: During program execution, a preset reflection mechanism is used to invoke the refresh strategy of the refresh class indicated by the instruction to be executed; The refresh strategy is executed using the current server, and the execution result is obtained.

5. The refresh method according to claim 4, characterized in that, After executing the refresh strategy and obtaining the execution result, the process also includes: The execution results are recorded in a result table, wherein the execution results include at least: result identifier, instruction identifier, server address, execution time, and execution result status.

6. The refresh method according to claim 5, characterized in that, Also includes: A first cleanup mechanism is set for the instruction table, wherein the first cleanup mechanism is to clean up expired instructions in the instruction table according to a first interval period; A second cleanup mechanism is set for the result table, wherein the second cleanup mechanism cleans up the execution results in the result table whose execution time is less than a preset time threshold according to a second interval period.

7. A memory object refresh device, characterized in that, include: A generation unit is used to generate an instruction table based on the changed data. Each instruction in the instruction table corresponds to a memory object. Each instruction includes at least a refresh class and a refresh strategy corresponding to the refresh class. The refresh strategy is used to refresh the memory object indicated by the refresh class. Each instruction in the instruction table also includes an instruction identifier, an expiration time, and a server type. The determining unit is configured to determine a set of instructions to be executed based on the instruction table. The traversal unit is used to traverse the set of instructions to be executed, and to obtain one instruction to be executed if the set of instructions to be executed is not empty; An execution unit is configured to execute the refresh strategy of the refresh class indicated by the instruction to be executed, wherein the process of executing the refresh strategy is the process of refreshing the corresponding memory object; The determining unit includes: a second acquisition module, used to acquire a first instruction set from an instruction table based on the expiration time of each instruction; a first determining module, used to determine the type of the current server and the address of the current server; a first deletion module, used to delete instructions whose server type is inconsistent with the type of the current server from the first instruction set based on the server type carried by each instruction, to obtain a second instruction set; and a first traversal module, used to traverse the execution results in the result table, and based on the address of the current server and the instruction identifier of the instruction, to determine the instructions from the second instruction set that are inconsistent with both the instruction identifier carried by the execution result and the server address, to obtain a set of instructions to be executed.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the memory object refresh method according to any one of claims 1 to 6.

9. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method for refreshing a memory object as described in any one of claims 1 to 6.