CN-121979551-A - Program abstract updating method and device, storage medium and electronic equipment
Abstract
The application discloses a program abstract updating method and device, a storage medium and electronic equipment. The method comprises the steps of obtaining an operation function required to be recalculated for a program abstract to be updated, obtaining at least one semantic type combination supported by the operation function, wherein the semantic type combination consists of semantic types supported by various parameters in the operation function, calculating at least one operation result of the operation function under different semantic type combinations according to various semantic type combinations in the at least one semantic type combination, and updating the program abstract based on the at least one operation result to obtain an updated program abstract. The application solves the technical problem of lower updating accuracy of the program abstract.
Inventors
- GU ZUXING
- WANG YAXING
- LI YIFAN
Assignees
- 腾讯科技(深圳)有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20241030
Claims (14)
- 1. A method for updating a program digest, comprising: Acquiring an operation function which is required to be recalculated for a program abstract to be updated; Acquiring at least one semantic type combination supported by the operation function, wherein the semantic type combination consists of semantic types supported by each parameter in the operation function; calculating at least one operation result of the operation function under different semantic type combinations according to each semantic type combination in the at least one semantic type combination; And updating the program abstract based on the at least one operation result to obtain an updated program abstract.
- 2. The method of claim 1, wherein said calculating at least one operation result of said operation function under different said semantic type combinations according to each of said at least one semantic type combination comprises: And iteratively calculating parameters in the operation function according to the semantic types configured by different semantic type combinations until reaching a convergence state, thereby obtaining the at least one operation result.
- 3. The method according to claim 2, wherein, in the case that the operation function includes a first parameter and a second parameter, the iteratively calculating parameters in the operation function according to semantic types configured by different semantic type combinations until reaching a convergence state, to obtain the at least one operation result includes: the following steps are executed until the convergence state is reached: determining a current semantic type combination from the at least one semantic type combination, wherein the current semantic type combination consists of a first semantic type currently configured by the first parameter and a second semantic type currently configured by the second parameter; Calculating the first parameter under the first semantic type and the second parameter under the second semantic type, and obtaining a current operation result in a grammar structure of the operation function; and under the condition that the current operation result indicates that the calculation of the operation function reaches a stable state, determining that the convergence state is reached, and taking the current operation result as an operation result in the at least one operation result.
- 4. The method of claim 1, wherein after updating the program digest based on the at least one operation result to obtain an updated program digest, the method further comprises: and storing the updated program abstract in a lasting way.
- 5. The method of claim 4, wherein prior to the operation function that is required to be recalculated in order to obtain the program digest to be updated, the method further comprises: Loading at least one abstract existing in the target program; Storing a first abstract of the at least one abstract in a lasting way under the condition that the first abstract does not need to be updated; and determining a second abstract as the program abstract under the condition that the second abstract in the at least one abstract needs to be updated.
- 6. The method of claim 1, wherein prior to the operation function that is required to be recalculated for the retrieval of the program digest to be updated, the method further comprises: And obtaining a function range which is required to be recalculated by the program abstract, wherein the operation function is positioned in the function range.
- 7. The method of claim 6, wherein after said obtaining the function range for which said program digest is to be recalculated, said method further comprises: Acquiring each function in the function range, and calculating the execution sequence to be recalculated; and sequentially recalculating each function in the function range according to the execution sequence.
- 8. The method of claim 7, wherein the obtaining the execution order of the functions within the function range to be recalculated includes: constructing a function call graph corresponding to the function range through a compiling unit in the function range; and on the basis of the function call graph, a topology ordering algorithm is applied to acquire the execution sequence.
- 9. The method according to any one of claims 1 to 8, characterized in that before the operation functions that need to be recalculated for the acquisition of the program digest to be updated, the method further comprises: in the case of reading a third digest to be updated from a first level cache, determining the third digest as the program digest, wherein the first level cache is used for storing frequently used digests, or, Requesting to read the digest to be updated from a second-level cache under the condition that the digest to be updated is not read from the first-level cache, wherein the second-level cache is used for storing the digest which is used frequently; in the case that a fourth digest to be updated is read from the second-level cache, the fourth digest is determined as the program digest.
- 10. The method according to any one of claims 1 to 8, wherein updating the program digest based on the at least one operation result, resulting in an updated program digest, comprises: And updating the changed part in the program abstract by utilizing the at least one operation result.
- 11. An apparatus for updating a program digest, comprising: the first acquisition unit is used for acquiring an operation function which is required to be recalculated for the program abstract to be updated; the second acquisition unit is used for acquiring at least one semantic type combination supported by the operation function, wherein the semantic type combination consists of semantic types supported by each parameter in the operation function; a first calculation unit, configured to calculate at least one operation result of the operation function under different semantic type combinations according to each semantic type combination in the at least one semantic type combination; and the updating unit is used for updating the program abstract based on the at least one operation result to obtain an updated program abstract.
- 12. A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a stored program, wherein the program, when run by an electronic device, performs the method of any one of claims 1 to 10.
- 13. A computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the method as claimed in any one of claims 1 to 10.
- 14. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method according to any of claims 1 to 10 by means of the computer program.
Description
Program abstract updating method and device, storage medium and electronic equipment Technical Field The present application relates to the field of computers, and in particular, to a method and apparatus for updating a program abstract, a storage medium, and an electronic device. Background In the update scene of the program abstract, the method generally only aims at a certain specific semantic type to recalculate, and the method ignores interaction and association between different semantic information, and fails to fully utilize the comprehensive effect between various semantic information, so that the problem of low update accuracy of the program abstract occurs. Therefore, there is a problem that update accuracy of the program digest is low. In view of the above problems, no effective solution has been proposed at present. Disclosure of Invention The embodiment of the application provides a program abstract updating method, a program abstract updating device, a storage medium and electronic equipment, which are used for at least solving the technical problem of low program abstract updating accuracy. According to one aspect of the embodiment of the application, an updating method of a program abstract is provided, which comprises the steps of obtaining an operation function required to be recalculated for the program abstract to be updated, obtaining at least one semantic type combination supported by the operation function, wherein the semantic type combination consists of semantic types supported by various parameters in the operation function, calculating at least one operation result of the operation function under different semantic type combinations according to the semantic type combinations in the at least one semantic type combination, and updating the program abstract based on the at least one operation result to obtain the updated program abstract. According to another aspect of the embodiment of the application, there is provided a program digest updating device, which comprises a first obtaining unit, a second obtaining unit and a first calculating unit, wherein the first obtaining unit is used for obtaining an operation function required to be recalculated for a program digest to be updated, the second obtaining unit is used for obtaining at least one semantic type combination supported by the operation function, the semantic type combination is composed of semantic types supported by parameters in the operation function, the first calculating unit is used for calculating at least one operation result of the operation function under different semantic type combinations according to the semantic type combinations in the at least one semantic type combination, and the updating unit is used for updating the program digest based on the at least one operation result to obtain an updated program digest. As an alternative, the first calculating unit includes a calculating module, configured to iteratively calculate parameters in the operation function according to semantic types configured by combining different semantic types until reaching a convergence state, to obtain the at least one operation result. As an alternative, the calculation module includes an execution sub-module, configured to execute, in a case where the operation function includes a first parameter and a second parameter, the steps of determining that the convergence state is reached from the at least one semantic type combination, where the current semantic type combination is composed of a first semantic type currently configured by the first parameter and a second semantic type currently configured by the second parameter, calculating the first parameter in the first semantic type and the second parameter in the second semantic type, determining that the convergence state is reached in a case where the current operation result indicates that the calculation of the operation function reaches a steady state, and taking the current operation result as an operation result in the at least one operation result. The device further comprises a first storage unit, configured to update the program digest based on the at least one operation result, and store the updated program digest for persistence after the updated program digest is obtained. As an alternative scheme, the device further comprises a loading unit, a second storage unit and a first determining unit, wherein the loading unit is used for loading at least one existing digest of a target program before the operation function needing to be recalculated for acquiring the program digest to be updated, the second storage unit is used for storing the first digest in a lasting mode under the condition that the first digest in the at least one digest does not need to be updated before the operation function needing to be recalculated for acquiring the program digest to be updated, and the first determining unit is used for determining the second digest as the program digest un