Application program updating method and device, electronic equipment and readable storage medium

By obtaining and replacing the application's business update functions and their identifiers, the system overhead and continuity issues caused by downtime and restart in traditional update methods are resolved, achieving efficient updates without restarting.

CN119739403BActive Publication Date: 2025-12-12GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411627936.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-12-12
Estimated Expiration
2044-11-14

AI Technical Summary

Technical Problem

Traditional application updates require system downtime and deployment of all business functions, leading to increased system overhead, reduced business continuity, and a poor user experience.

Method used

By obtaining the application's business update function and its associated identifier, the business function to be updated is replaced with the business update function, and the function's calling status is controlled by modifying field values, thus avoiding application restarts.

Benefits of technology

It reduced system overhead, improved business continuity and update efficiency, and reduced business function call latency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739403B_ABST
    Figure CN119739403B_ABST
Patent Text Reader

Abstract

The application provides an application program updating method and device, electronic equipment and readable storage medium, comprising: in response to an updating request instruction of an application program, obtaining a business updating function of the application program and an identifier associated with the business updating function included in the updating request instruction; obtaining a value of a first field corresponding to the business updating function, modifying the value of the first field to a first value; obtaining a to-be-updated business function corresponding to the business updating function according to the identifier, and replacing the to-be-updated business function with the business updating function; modifying the value of the first field to a second value; after all the to-be-updated business functions corresponding to the business updating function are replaced, completing the updating of the application program. Not only can the system overhead be reduced, but also the time delay of the business updating function call can be reduced, and the continuity of the business is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of computers, and particularly relates to an application program updating method and device, electronic equipment and a readable storage medium. BACKGROUND

[0002] With the progress of technology and changes in market demand, application programs need to be constantly updated to fix known problems or optimize performance, to cope with market challenges and opportunities.

[0003] The traditional application program updating method is to shut down the application program after receiving an updating request instruction, and then redeploy all business functions needed on the application program and restart the application program when updating the application program.

[0004] The traditional application program updating method often needs to shut down the application program and deploy all business functions, which not only increases system overhead but also reduces business continuity, and is not conducive to user experience. SUMMARY

[0005] The present application aims to provide an application program updating method and device, electronic equipment and a readable storage medium, which at least solve the problem in the prior art that the application program needs to be shut down and all business functions need to be deployed, which not only increases system overhead but also reduces business continuity, and is not conducive to user experience.

[0006] In a first aspect, an application program updating method is disclosed, and the method comprises:

[0007] In response to an updating request instruction for an application program, a business updating function of the application program included in the updating request instruction and an identifier associated with the business updating function are obtained; the identifier is used to indicate a to-be-updated business function corresponding to the business updating function;

[0008] The value of a first field corresponding to the business updating function is obtained, and the value of the first field is modified to a first value; the first value is used to represent that the to-be-updated business function is in an uncallable state;

[0009] According to the identifier, a to-be-updated business function corresponding to the business updating function is obtained, and the to-be-updated business function is replaced with the business updating function;

[0010] The value of the first field is modified to a second value; the second value is used to represent that the business updating function is in a callable state; and the second value is a value different from the first value;

[0011] After all the to-be-updated business functions corresponding to the business update functions are replaced, the updating of the application program is completed.

[0012] In a second aspect, the embodiments of the present application disclose an application program updating apparatus, which comprises:

[0013] The first obtaining module is configured to, in response to an updating request instruction of an application program, obtain a business update function of the application program and an identifier associated with the business update function included in the updating request instruction; the identifier is used to indicate a to-be-updated business function corresponding to the business update function.

[0014] The first modifying module is configured to obtain a value of a first field corresponding to the business update function, and modify the value of the first field into a first value; the first value is used to represent that the to-be-updated business function is in an un-callable state.

[0015] The replacing module is configured to, according to the identifier, obtain the to-be-updated business function corresponding to the business update function, and replace the to-be-updated business function with the business update function.

[0016] The second modifying module is configured to modify the value of the first field into a second value; the second value is used to represent that the business update function is in a callable state; and the second value is different from the first value.

[0017] The ending module is configured to, after all the to-be-updated business functions corresponding to the business update functions are replaced, complete the updating of the application program.

[0018] In a third aspect, the embodiments of the present application further disclose an electronic device, which comprises a processor and a memory; the memory stores programs or instructions which can be run on the processor; and the programs or instructions are executed by the processor to implement the steps of the method according to the first aspect.

[0019] In a fourth aspect, the embodiments of the present application further disclose a readable storage medium, which stores programs or instructions; and the programs or instructions are executed by a processor to implement the steps of the method according to the first aspect.

[0020] In summary, in the embodiments of the present application, the service update function of the application program and the identifier associated with the service update function are obtained, the to-be-updated service function corresponding to the service update function is obtained according to the identifier, and the to-be-updated service function is replaced with the service update function. After all the to-be-updated service functions corresponding to the service update functions are replaced, the update of the application program is completed. Instead of deploying all the service functions required when updating the application program on the application program, the system overhead can be reduced. In addition, by obtaining the value of the first field corresponding to the service update function, the value of the first field is modified to the first value to make the to-be-updated service function in an uncallable state. After the to-be-updated service function is replaced with the service update function, the value of the first field is modified to the second value to make the service update function in a callable state. There is no need to restart the application program, and the service update function is called after the application program is restarted. Instead, the update state of the service update function is represented by the first field corresponding to the service update function. When the value of the first field is the second value, the service update function can be called. Therefore, the time delay of the service update function call can be reduced, and the continuity of the service is improved. BRIEF DESCRIPTION OF DRAWINGS

[0021] In the drawings:

[0022] Figure 1 is a step flow chart of an application program update method provided by an embodiment of the present application;

[0023] Figure 2 is a step flow chart of another application program update method provided by an embodiment of the present application;

[0024] Figure 3 is a step flow chart of another application program update method provided by an embodiment of the present application;

[0025] Figure 4 is a block diagram of an application program update device provided by an embodiment of the present application;

[0026] Figure 5 is a block diagram of an electronic device of an embodiment provided by an embodiment of the present application;

[0027] Figure 6 is a block diagram of an electronic device of another embodiment provided by an embodiment of the present application. DETAILED DESCRIPTION

[0028] With reference to the drawings, the technical solutions in the embodiments of the present application will be clearly and completely described below. Obviously, the described embodiments are only some of the embodiments of the present application, but not all of them. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.

[0029] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of a kind and do not limit the number of objects, for example, the first object can be one or more. In addition, "and / or" in the specification and claims indicates at least one of the connected objects, and the character " / ", generally indicates that the front and rear associated objects are in an "or" relationship.

[0030] With the development and change of business, application programs need to be frequently updated to introduce new functions, fix known problems or optimize performance. Application program update refers to the process of repairing and improving the application program, and performing application program update can fix vulnerabilities in the application program and improve the performance and stability of the application program.

[0031] The traditional application program update method, after receiving the update request instruction, stops the application program, and then deploys all the business functions required during the application program update on the application program and restarts the application program. The traditional application program update method often requires the application program to be stopped, which will have a negative impact on the continuity of the business and user experience. Therefore, there is a strong demand for no-downtime update technology to ensure that the business can continue to run during the update process.

[0032] In the embodiment of the present application, the business update function of the application program and the identifier associated with the business update function are obtained, the to-be-updated business function corresponding to the business update function is obtained according to the identifier, and the to-be-updated business function is replaced with the business update function. After all the to-be-updated business functions corresponding to the business update function are replaced, the update of the application program is completed. Instead of deploying all the business functions required when updating the application program on the application program, the system overhead can be reduced. In addition, by obtaining the value of the first field corresponding to the business update function, the value of the first field is modified to the first value to make the to-be-updated business function in an uncallable state. After the to-be-updated business function is replaced with the business update function, the value of the first field is modified to the second value to make the business update function in a callable state. Instead of restarting the application program, the update state of the business update function is represented by the first field corresponding to the business update function. When the value of the first field is the second value, the business update function can be called. Therefore, the time delay of the business update function call can be reduced, and the continuity of the business is improved.

[0033] Figure 1 is a step flow chart of an application program updating method provided by the embodiment of the present application, referring to Figure 1 , the method can include the following steps:

[0034] Step 101, in response to an update request instruction of an application program, obtaining a business update function of the application program and an identifier associated with the business update function included in the update request instruction; the identifier is used to indicate a to-be-updated business function corresponding to the business update function.

[0035] For example, the update request instruction is used to obtain the latest data, information or state. It plays an important role in software applications, online services or database management systems, ensuring that users can obtain accurate and real-time information. For example, in a software application, when a developer releases a new version, the user may receive a prompt asking whether to update the application. After the user clicks the "update" button, a signal that the update has been requested is sent, and the system will start downloading and installing the latest version of the application program.

[0036] For example, the update request instruction can be triggered automatically by the user, the system or the application program, with the purpose of ensuring the accuracy and real-time performance of the business update function. In response to the update request instruction of the application program, the latest business update function and the identifier associated with the business update function can be obtained.

[0037] The business updating function can also be referred to as a new function. The business updating function can be a method code block, which processes parameters in the method code block by passing in the parameters, and then outputs the processing result. For example, the business function can be a blackcall function.

[0038] The identifier can be information anchored to the business function to be updated, and is used to indicate the business function to be updated corresponding to the business updating function. Specifically, the identifier can also be used to locate a memory segment of the business function to be updated, so that the business function to be updated is replaced by the business updating function in the memory segment of the business function to be updated.

[0039] In step 102, a value of a first field corresponding to the business updating function is obtained, and the value of the first field is modified to a first value. The first value is used to represent that the business function to be updated is in an uncallable state.

[0040] The value of the first field corresponds to the business updating function one by one, and each business updating function has a value of the first field.

[0041] The first field can be a sign field, and the first value can be 1, indicating that the business function to be updated is in an uncallable state. That is, when the business function to be updated is updated, the business function to be updated is locked, and an external program cannot obtain the business function to be updated.

[0042] The first field can be a sign field, and the first value can be 1, indicating that the business function to be updated is in an uncallable state. That is, when the business function to be updated is updated, the business function to be updated is locked, and an external program cannot obtain the business function to be updated.

[0043] In step 103, according to the identifier, the business function to be updated corresponding to the business updating function is obtained, and the business function to be updated is replaced by the business updating function.

[0044] The identifier can be information anchored to the business function to be updated. According to the identifier, the business function to be updated can be queried, so that the business function to be updated is replaced by the business updating function in a memory segment where the business function to be updated is located. For example, the identifier can be name=blackCall, the identifier can be index=16, and the identifier can also be name=blackCall, index=16.

[0045] For example, according to the identifier, the to-be-updated business function related to the identifier can be anchored, for example, according to the identifier name=blackCall, the to-be-updated business function with the name blackcall can be obtained, so that the to-be-updated business function with the name blackcall can be replaced by the business update function. For another example, for example, according to the identifier index=16, the to-be-updated business function with the coordinate 16 can be obtained, so that the to-be-updated business function with the coordinate 16 can be replaced by the business update function.

[0046] In step 104, the value of the first field is modified to a second value; the second value is used to represent that the business update function is in a callable state; and the second value is different from the first value.

[0047] For example, the second value can be 0, indicating that the business update function is in a callable state, that is, the to-be-updated business function has been replaced by the business update function, the update is completed, the to-be-updated business function is unlocked, and the external program can call the business update function and execute the business update function.

[0048] For example, the first value can also be 0, and the second value can also be 1, as long as the first value and the second value are different.

[0049] For example, in the process of replacing the to-be-updated business function with the business update function, by modifying the value of the first field corresponding to the business update function, the safety release of the to-be-updated business function and the correct loading of the business update function can be ensured.

[0050] For example, after the to-be-updated business function is replaced by the business update function, the value of the first field corresponding to the business update function is modified to the second value, that is, 0, so that the business update function is in a callable state, the external program can call the business update function and execute the business update function, without the need to restart the application program, and the business update function is called after restarting, so that the timeliness of the business update function can be reduced and the continuity of the business can be improved.

[0051] In step 105, after all the to-be-updated business functions corresponding to the business update functions are replaced, the update of the application program is completed.

[0052] For example, after the to-be-updated business function to be updated is replaced by the corresponding business update function, the application program update is completed.

[0053] For example, when the number of business update functions is 3, the business update function 1 is used to replace the to-be-updated business function 1 corresponding to the business update function 1, the business update function 2 is used to replace the to-be-updated business function 2 corresponding to the business update function 2, and the business update function 3 is used to replace the to-be-updated business function 3 corresponding to the business update function 3, the updating of the application program is completed.

[0054] In conclusion, in the embodiment of the present application, the business update functions of the application program and the identifiers associated with the business update functions are obtained, the to-be-updated business functions corresponding to the business update functions are obtained according to the identifiers, and the to-be-updated business functions are replaced by the business update functions. After the to-be-updated business functions corresponding to all the business update functions are replaced, the updating of the application program is completed. Instead of deploying all the business functions of the application program again when the application program is updated, the system overhead can be reduced. In addition, by obtaining the value of the first field corresponding to the business update function, the value of the first field is modified to the first value to make the to-be-updated business function in an uncallable state. After the to-be-updated business function is replaced by the business update function, the value of the first field is modified to the second value to make the business update function in a callable state. Instead of restarting the application program, the update state of the business update function is represented by the first field corresponding to the business update function. When the value of the first field is the second value, the business update function can be called. Therefore, the latency of the business update function call can be reduced, and the continuity of the business is improved.

[0055] Figure 2 FIG. 2 is a flowchart of another application program updating method provided by the present application, which is described in detail below. Figure 2 The method can include the following steps.

[0056] Step 201, in response to an updating request instruction of an application program, obtaining business update functions of the application program and identifiers associated with the business update functions included in the updating request instruction; the identifier is used to indicate a to-be-updated business function corresponding to the business update function.

[0057] This step can refer to the above step 101, which will not be described here.

[0058] Optionally, step 201 can specifically include:

[0059] Substep 2011, if there are multiple business update functions, determining the update order of each business update function according to the time stamp of each business update function reaching the application program.

[0060] Substep 2012, obtaining the business update functions and the identifiers associated with the business update functions according to the update order of each business update function.

[0061] For sub-step 2011-sub-step 2012, taking the number of business update functions as 3 for example, if the time when the business update function 1 reaches the application program is earlier than the time when the business update function 3 reaches the application program, and the time when the business update function 3 reaches the application program is earlier than the time when the business update function 2 reaches the application program, first, the business update function 1 is updated, then the business update function 3 is updated, and finally, the business update function 2 is updated. According to the update order of the business update function 1, the business update function 3 and the business update function 2, the business update function 1 and the identifier associated with the business update function 1 are acquired first, then the business update function 3 and the identifier associated with the business update function 3, the business update function 2 and the identifier associated with the business update function 2 are acquired.

[0062] In step 202, the value of the first field corresponding to the business update function is acquired, and the value of the first field is modified to a first value; the first value is used to represent that the to-be-updated business function is in an uncallable state.

[0063] This step can refer to the above-mentioned step 102, and will not be described here.

[0064] In step 203, the to-be-updated business function corresponding to the business update function is obtained according to the identifier, and the memory segment of the to-be-updated business function in the function pool is acquired; the function pool stores the to-be-updated business function.

[0065] For example, the function pool stores the to-be-updated business function, which can be understood as putting the to-be-updated business function into a function set, storing the to-be-updated business function through the set, maintaining the to-be-updated business function in the set, and after replacing the to-be-updated business function with the business update function, the external calling program can take out the business update function from the set and execute the business update function.

[0066] For example, the function pool can store the function name and the to-be-updated business function. The to-be-updated business function with the same function name as the business update function is obtained through the function name of the business update function, and the to-be-updated business function with the same function name as the business update function is taken as the to-be-updated business function corresponding to the business update function.

[0067] For example, the function pool can also store the function coordinates and the to-be-updated business function. The function coordinates refer to recording the sequence coordinates of the to-be-updated business function in the function set when the to-be-updated business function is put into the function set, and the to-be-updated business function with the same function coordinates as the business update function is obtained through the function coordinates. The to-be-updated business function with the same function coordinates as the business update function is taken as the to-be-updated business function corresponding to the business update function.

[0068] According to the identifier, the memory segment of the to-be-updated service function in the function pool is obtained, that is, the to-be-updated service function related to the identifier can be anchored according to the identifier, so that the position of the to-be-updated service function in the function pool can be obtained.

[0069] Optionally, the identifier is a function name; and the step 203 specifically can include:

[0070] The sub-step 2031 obtains the to-be-updated service function matching the function name of the service update function according to the first correspondence relationship between the function name in the function pool and the to-be-updated service function, and takes the to-be-updated service function matching the function name of the service update function as the to-be-updated service function corresponding to the service update function.

[0071] Optionally, the function pool stores the function name and the to-be-updated service function; after the service update function is obtained, the to-be-updated service function matching the function name of the service update function in the function pool is obtained, which is the to-be-updated service function corresponding to the service update function.

[0072] For example, the function name is blackcall, and the identifier is name=blackcall; the to-be-updated service function with the function name blackcall in the function pool is taken as the to-be-updated service function corresponding to the service update function.

[0073] Optionally, the identifier is a function coordinate; and the step 203 specifically can further include:

[0074] The sub-step 2032 obtains the to-be-updated service function matching the function coordinate of the service update function according to the second correspondence relationship between the function coordinate in the function pool and the to-be-updated service function, and takes the to-be-updated service function matching the function coordinate of the service update function as the to-be-updated service function corresponding to the service update function.

[0075] Optionally, the function pool stores the function coordinate and the to-be-updated service function; after the service update function is obtained, the to-be-updated service function matching the function coordinate of the service update function in the function pool is obtained, which is the to-be-updated service function corresponding to the service update function.

[0076] For example, the function coordinate is 16, and the identifier is index=16; the to-be-updated service function with the function coordinate 16 in the function pool is taken as the to-be-updated service function corresponding to the service update function.

[0077] For example, the function pool stores a function name, a function coordinate, and a to-be-updated business function. After obtaining the business update function, the to-be-updated business function in the function pool that matches the function name and the function coordinate of the business update function is obtained, that is, the to-be-updated business function corresponding to the business update function.

[0078] For example, the function name is blackcall, and the function coordinate is 16, that is, the identifier is name=blackcall, index=16. The to-be-updated business function with the function name blackcall and the function coordinate 16 in the function pool is taken as the to-be-updated business function corresponding to the business update function.

[0079] For example, the function name is blackcall, and the function coordinate is 16, that is, the identifier is name=blackcall, index=16. The to-be-updated business function with the function name blackcall and the function coordinate 16 in the function pool is taken as the to-be-updated business function corresponding to the business update function.

[0080] For example, the function pool stores a function name, a function coordinate, and a to-be-updated business function. After obtaining the business update function, the to-be-updated business function in the function pool that matches the function name and the function coordinate of the business update function is obtained, that is, the to-be-updated business function corresponding to the business update function.

[0081] Optionally, before step 204, the method further includes:

[0082] Step A1, obtaining a value of a second field; the second field is used to indicate the current write permission of the function pool.

[0083] Step A2, if the value of the second field is a third value, modifying the value of the second field to a fourth value; the third value is used to represent that the business update function can write into the function pool; the fourth value is used to represent that the business update functions included in the update request instruction except the business update function cannot write into the function pool; the fourth value is a value different from the third value.

[0084] After step 204, the method further includes:

[0085] Step A3, modifying the value of the second field to the third value.

[0086] For steps A1-A3, the third value can be 0, indicating that the business update function can write into the function pool, that is, the business update function has write permission. The fourth value can be 1, indicating that the business update functions included in the update request instruction except the business update function cannot write into the function pool, that is, the other business update functions do not have write permission.

[0087] The value of the second field is obtained. If the value of the second field is 0, it indicates that the business update function can write into the function pool. The value of the second field is modified to 1, the to-be-updated business function is deleted, the business update function is written into the memory segment where the to-be-updated business function is located, and then the value of the second field is modified to 0, so that the to-be-updated business function corresponding to other business update functions can be updated. The value of the second field is obtained, and whether the write permission is determined according to the value of the second field. The implementation is relatively simple.

[0088] Of course, the third value can be 1, indicating that the business update function can write into the function pool, that is, the business update function has write permission. The fourth value can be 0, indicating that the business update function included in the update request instruction cannot write into the function pool, that is, other business update functions do not have write permission. The third value and the fourth value are different.

[0089] Optionally, the method further comprises:

[0090] Step A4, if the value of the second field is the fourth value, the business update function is added to the waiting queue, and the value of the second field is reacquired until the value of the second field is the third value, and the step of modifying the value of the second field to the fourth value is executed.

[0091] For example, the third value is 0 and the fourth value is 1. If the value of the second field is 1, it indicates that the business update function currently does not have write permission. The business update function is added to the waiting queue, the value of the second field is reacquired, and the value of the second field is 0, indicating that the business update function currently has write permission and can write into the function pool. Then the value of the second field is modified to 1, the to-be-updated business function is deleted, the business update function is written into the memory segment where the to-be-updated business function is located, and then the value of the second field is modified to 0, so that the to-be-updated business function corresponding to other business update functions can be updated.

[0092] Step 205, modify the value of the first field to a second value; the second value is used to represent that the business update function is in a callable state; and the second value is a value different from the first value.

[0093] In an example, after the to-be-updated business function is deleted and the business update function is written in the memory area where the to-be-updated business function is located, the value of the first field corresponding to the business update function is modified to the second value, i.e., 0, so that the business update function is in a callable state, and the external program can call the business update function and execute the business update function. Without restarting the application program, the business update function is called after the application program is restarted, so that the timeliness of calling the business update function can be reduced and the continuity of the business can be improved.

[0094] In step 206, after the to-be-updated business function corresponding to all the business update functions is replaced, the updating of the application program is completed.

[0095] In an example, the number of business update functions is 3, the updating sequence is: updating the business update function 1, updating the business update function 3, and updating the business update function 2. After the to-be-updated business function 1 corresponding to the business update function 1 is replaced by the business update function 1, the to-be-updated business function 3 corresponding to the business update function 3 is replaced by the business update function 3, and finally, the to-be-updated business function 2 corresponding to the business update function 2 is replaced by the business update function 2. After that, the updating of the application program is completed.

[0096] Optionally, the method further comprises:

[0097] In step 207, during the updating of the application program, if an exception occurs, the exception information is recorded in a log file.

[0098] In step 208, if the number of exception information in the log file exceeds a preset threshold, an alarm or a message of the exception is sent.

[0099] Optionally, the exception information includes: the value of the first field cannot be obtained, the modification of the value of the first field fails, and the replacement of the to-be-updated business function by the business update function fails.

[0100] In steps 207-208, during the updating of the application program, if an exception occurs, such as the value of the first field cannot be obtained, the modification of the value of the first field fails, or the replacement of the to-be-updated business function by the business update function fails, the exception information is recorded in a log file.

[0101] In an example, when the number of exception information in the log file exceeds 10, an alarm or a message of the exception is sent. Of course, the alarm or the message of the exception can also be sent when the exception information occurs.

[0102] Optionally, the method further comprises:

[0103] Step 209, in the process of calling the service update function, if the service update function cannot be acquired, a preset rule is used for processing; the preset rule includes: re-calling the service update function, recording an error.

[0104] For example, in the process of calling the service update function, if the service update function cannot be acquired, the service update function can be re-called.

[0105] For example, in the process of calling the service update function, if the service update function cannot be acquired, an error can be recorded, that is, the service update function cannot be acquired.

[0106] In the embodiment of the present application, the service update function of the application program and the identifier associated with the service update function are acquired, the to-be-updated service function corresponding to the service update function is obtained according to the identifier, and the to-be-updated service function is replaced with the service update function. After all the to-be-updated service functions corresponding to the service update functions are replaced, the update of the application program is completed, and therefore, when the application program is updated, all the service functions required by the application program do not need to be deployed on the application program, so that the system overhead can be reduced. In addition, by acquiring the value of the first field corresponding to the service update function, the value of the first field is modified to the first value, so that the to-be-updated service function is in an un-callable state. After the to-be-updated service function is replaced with the service update function, the value of the first field is modified to the second value, so that the service update function is in a callable state. Instead of restarting the application program, the update state of the service update function is represented by the first field corresponding to the service update function. When the value of the first field is the second value, the service update function can be called, so that the time delay of calling the service update function can be reduced, and the continuity of the service is improved.

[0107] Referring to Figure 3 which shows a step flowchart of another application program updating method provided by the embodiment of the present application, and specifically includes:

[0108] S1, in response to an update request instruction, a service update function is acquired;

[0109] S2, the value of the second field is acquired, and it is determined whether the value of the second field is a third value. If the value of the second field is not the third value, step S3 is executed, and if the value of the second field is the third value, step S4 is executed.

[0110] S3, the service update function is added to a waiting queue, and the value of the second field is re-acquired, and step S2 is executed.

[0111] S4, the value of the second field is modified to a fourth value.

[0112] S5, replacing the to-be-updated business function with the business update function;

[0113] S6, modifying the value of the second field to a third value;

[0114] S7, calling the business update function and executing the business update function.

[0115] In the embodiment of the present application, the business update function of the application program and the identifier associated with the business update function are obtained, the to-be-updated business function corresponding to the business update function is obtained according to the identifier, and the to-be-updated business function is replaced with the business update function. After all the to-be-updated business functions corresponding to the business update function are replaced, the update of the application program is completed, and therefore, when the application program is updated, all the business functions required need not be deployed on the application program, so that the system overhead can be reduced. In addition, the value of the first field corresponding to the business update function is obtained, the value of the first field is modified to a first value, so that the to-be-updated business function is in an uncallable state. After the to-be-updated business function is replaced with the business update function, the value of the first field is modified to a second value, so that the business update function is in a callable state. The application program does not need to be restarted, but the update state of the business update function is represented by the first field corresponding to the business update function. When the value of the first field is the second value, the business update function can be called, so that the time delay of the business update function can be reduced, and the continuity of the business is improved.

[0116] Referring to Figure 4 The application program updating apparatus 30 provided by the embodiment of the present application comprises:

[0117] The first obtaining module 301 is configured to, in response to an update request instruction of an application program, obtain a business update function of the application program and an identifier associated with the business update function included in the update request instruction. The identifier is used to indicate a to-be-updated business function corresponding to the business update function.

[0118] The first modifying module 302 is configured to obtain a value of a first field corresponding to the business update function, and modify the value of the first field to a first value. The first value is used to represent that the to-be-updated business function is in an uncallable state.

[0119] The replacing module 303 is configured to obtain the to-be-updated business function corresponding to the business update function according to the identifier, and replace the to-be-updated business function with the business update function.

[0120] The second modification module 304 is configured to modify the value of the first field to a second value; the second value is used to represent that the service update function is in a callable state; and the second value is different from the first value.

[0121] The ending module 305 is configured to complete the update of the application after all the service update functions replace the to-be-updated service functions.

[0122] Optionally, the function pool stores the to-be-updated service functions; and the replacing module 303 comprises:

[0123] The first obtaining sub-module is configured to obtain a memory segment of the to-be-updated service function in the function pool;

[0124] The processing sub-module is configured to delete the to-be-updated service function and write the service update function into the memory segment where the to-be-updated service function is located.

[0125] Optionally, the apparatus further comprises:

[0126] The second obtaining module is configured to obtain a value of a second field; the second field is used to indicate a current write permission of the function pool;

[0127] The third modification module is configured to modify the value of the second field to a fourth value if the value of the second field is a third value; the third value is used to represent that the service update function can write into the function pool; the fourth value is used to represent that service update functions other than the service update function included in the update request instruction cannot write into the function pool; and the fourth value is different from the third value.

[0128] The fourth modification module is configured to modify the value of the second field to the third value.

[0129] Optionally, the apparatus further comprises:

[0130] The third obtaining module is configured to add the service update function into a waiting queue if the value of the second field is the fourth value, and re-obtain the value of the second field until the value of the second field is the third value, and then execute the step of modifying the value of the second field to the fourth value.

[0131] Optionally, the identifier is a function name; and the replacing module comprises:

[0132] The second obtaining sub-module is configured to obtain the to-be-updated business function matching the function name of the business update function according to the first correspondence relationship between the function name in the function pool and the to-be-updated business function, and take the to-be-updated business function matching the function name of the business update function as the to-be-updated business function corresponding to the business update function.

[0133] Optionally, the identifier is a function coordinate; and the replacing module comprises:

[0134] The third obtaining sub-module is configured to obtain the to-be-updated business function matching the function coordinate of the business update function according to the second correspondence relationship between the function coordinate in the function pool and the to-be-updated business function, and take the to-be-updated business function matching the function coordinate of the business update function as the to-be-updated business function corresponding to the business update function.

[0135] Optionally, the apparatus further comprises:

[0136] The recording module is configured to, in the process of updating the application program, record abnormal information in a log file if an exception occurs;

[0137] The sending module is configured to send an alarm or an exception message if the number of abnormal information in the log file exceeds a preset threshold.

[0138] Optionally, the abnormal information comprises: failure to obtain the value of the first field, failure to modify the value of the first field, and failure to replace the to-be-updated business function with the business update function.

[0139] Optionally, the apparatus further comprises:

[0140] The processing module is configured to, in the process of calling the business update function, perform processing according to a preset rule if the business update function cannot be obtained; and the preset rule comprises: re-calling the business update function and recording an error.

[0141] Optionally, the first obtaining module comprises:

[0142] The determining sub-module is configured to, if there are a plurality of business update functions, determine the update order of each business update function according to the time stamp of each business update function reaching the application program.

[0143] The fourth obtaining sub-module is configured to obtain the business update function and the identifier associated with the business update function according to the update order of each business update function.

[0144] In the embodiment of the present application, the business update function of the application program and the identifier associated with the business update function are acquired, the to-be-updated business function corresponding to the business update function is obtained according to the identifier, and the to-be-updated business function is replaced by the business update function. After all the to-be-updated business functions corresponding to the business update function are replaced, the update of the application program is completed. Instead of deploying all the business functions required when updating the application program on the application program, the system overhead can be reduced. In addition, by acquiring the value of the first field corresponding to the business update function, the value of the first field is modified to the first value to make the to-be-updated business function in an uncallable state. After the to-be-updated business function is replaced by the business update function, the value of the first field is modified to the second value to make the business update function in a callable state. Instead of restarting the application program, the update state of the business update function is represented by the first field corresponding to the business update function. When the value of the first field is the second value, the business update function can be called. Therefore, the time delay of the business update function call can be reduced, and the continuity of the business is improved.

[0145] Referring to Figure 5 , the electronic device 400 can include one or more of the following components: a processing component 402, a memory 404, a power supply component 406, a multimedia component 408, an audio component 410, an input / output (I / O) interface 412, a sensor component 414, and a communication component 416.

[0146] The processing component 402 usually controls the overall operation of the electronic device 400, such as operations associated with displaying, making phone calls, data communications, camera operations, and recording operations. The processing component 402 can include one or more processors 420 to execute instructions to complete all or part of the steps of the methods described above. In addition, the processing component 402 can include one or more modules to facilitate interaction between the processing component 402 and other components. For example, the processing component 402 can include a multimedia module to facilitate the interaction between the multimedia component 408 and the processing component 402.

[0147] The memory 404 is used to store various types of data to support the operation of the electronic device 400. Examples of these data include instructions for operating any application or method on the electronic device 400, contact data, phonebook data, messages, pictures, multimedia, etc. The memory 404 can be realized by any type of volatile or non-volatile storage device or their combination, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0148] Power component 406 provides power to various components of electronic device 400. Power component 406 can include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for electronic device 400.

[0149] Multimedia component 408 includes an interface for outputting various forms of media content to a user. In some embodiments, the interface can include a liquid crystal display (LCD) and a touch panel (TP). If the interface includes a touch panel, the interface can be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, swiping, and gestures on the touch panel. The touch sensors can not only sense the boundary of a touch or swiping action, but also detect duration and pressure associated with the touch or swiping action. In some embodiments, multimedia component 408 includes a front-facing camera and / or a rear-facing camera. The front-facing camera and / or the rear-facing camera can receive external multimedia data when electronic device 400 is in an operation mode, such as a shooting mode or a multimedia mode. Each of the front-facing camera and the rear-facing camera can be a fixed optical lens system or have a focal length and optical zoom capability.

[0150] Audio component 410 is configured to output and / or input audio signals. For example, audio component 410 includes a microphone (MIC) for receiving an external audio signal when electronic device 400 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in memory 404 or transmitted via communication component 416. In some embodiments, audio component 410 also includes a speaker for outputting audio signals.

[0151] Input / output (I / O) interface 412 provides an interface between processing component 402 and peripheral interface modules, such as a keyboard, a click wheel, buttons, and the like. The buttons can include, but are not limited to, a home button, a volume button, a start button, and a lock button.

[0152] The sensor component 414 includes one or more sensors for providing status assessments for various aspects of the electronic device 400. For example, the sensor component 414 can detect an open / closed position of the electronic device 400, relative positioning of components, such as a display and a keypad of the electronic device 400, a change in position of the electronic device 400 or a component of the electronic device 400, the presence or absence of user contact with the electronic device 400, the orientation or acceleration / deceleration / g-force and a temperature change of the electronic device 400. The sensor component 414 can include an optical sensor for detecting ambient light, a proximity sensor configured to detect the presence of nearby objects without any physical touch, or a CMOS or CCD image sensor for use in imaging applications. In some embodiments, the sensor component 414 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0153] The communication component 416 is configured to facilitate wired or wireless communication between the electronic device 400 and other devices. The electronic device 400 can access a wireless network based on a communication standard, such as WiFi, a cellular network standard (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an example embodiment, the communication component 416 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an example embodiment, the communication component 416 can further include a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) techniques, infrared data association (IrDA) techniques, ultra-wideband (UWB) techniques, Bluetooth (BT) techniques, and other techniques.

[0154] In an example embodiment, the electronic device 400 can be implemented with one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic elements to implement a method for updating an application program according to embodiments of the present application.

[0155] In an example embodiment, a non-transitory computer-readable storage medium including instructions, such as the memory 404 including instructions, is also provided, which can be executed by the processor 420 of the electronic device 400 to implement the above-described method. For example, the non-transitory storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disc, and an optical data storage device, etc.

[0156] Figure 6FIG. 5 is a block diagram of an electronic device 500 according to another embodiment of the present application. For example, the electronic device 500 can be provided as a server. Referring to FIG. 5, the electronic device 500 includes a processing component 522, which further includes one or more processors, and a memory resource represented by a memory 532 for storing instructions, such as an application, executable by the processing component 522. The application stored in the memory 532 can include one or more modules each corresponding to a set of instructions. In addition, the processing component 522 is configured to execute the instructions to perform an application update method according to an embodiment of the present application. Figure 6 The electronic device 500 can further include a power component 526 configured to perform power management of the electronic device 500, a wired or wireless network interface 550 configured to connect the electronic device 500 to a network, and an input / output (I / O) interface 558. The electronic device 500 can operate based on an operating system stored in the memory 532, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or the like.

[0157] The electronic device 500 can further include a power component 526 configured to perform power management of the electronic device 500, a wired or wireless network interface 550 configured to connect the electronic device 500 to a network, and an input / output (I / O) interface 558. The electronic device 500 can operate based on an operating system stored in the memory 532, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or the like.

[0158] Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. It is intended that the specification and examples be considered as exemplary only, with the true scope and spirit of the application being indicated by the following claims.

[0159] It is to be understood that the application is not limited to the precise construction described in the specification and shown in the drawings, and various modifications and changes can be effected therein by those skilled in the art without departing from the scope of the application. The scope of the application is to be limited only by the appended claims.

Claims

1. An application program updating method characterized by comprising: The method comprises: in response to an update request instruction of an application, obtaining a business update function of the application included in the update request instruction and an identifier associated with the business update function; the identifier is used to indicate a to-be-updated business function corresponding to the business update function; obtaining a value of a first field corresponding to the business update function, and modifying the value of the first field to a first value; the first value is used to represent that the to-be-updated business function is in an uncallable state; obtaining the to-be-updated business function corresponding to the business update function according to the identifier, and replacing the to-be-updated business function with the business update function; modifying the value of the first field to a second value; the second value is used to represent that the business update function is in a callable state; the second value is different from the first value; after the to-be-updated business functions corresponding to all the business update functions are replaced, completing the update of the application; before the to-be-updated business function is replaced with the business update function, the method further comprises: obtaining a value of a second field; the second field is used to indicate the current write permission of a function pool; if the value of the second field is a third value, modifying the value of the second field to a fourth value; the third value is used to represent that the business update function can write to the function pool; the fourth value is used to represent that the business update functions included in the update request instruction except the business update function cannot write to the function pool; the fourth value is different from the third value; after the to-be-updated business function is replaced with the business update function, the method further comprises: modifying the value of the second field to the third value.

2. The method of claim 1, wherein, The to-be-updated business function is stored in the function pool; the to-be-updated business function is replaced with the business update function, comprising: obtaining a memory segment of the to-be-updated business function in the function pool; deleting the to-be-updated business function, and writing the business update function in the memory segment where the to-be-updated business function is located.

3. The method of claim 1, wherein, The method further comprises: if the value of the second field is the fourth value, adding the business update function to a waiting queue, and re-obtaining the value of the second field until the value of the second field is the third value, and entering the step of modifying the value of the second field to the fourth value.

4. The method of claim 1, wherein, The identifier is a function name; the to-be-updated business function corresponding to the business update function is obtained according to the identifier, comprising: obtaining the to-be-updated business function matched with the function name of the business update function according to a first correspondence relationship between the function name and the to-be-updated business function in the function pool, and taking the to-be-updated business function matched with the function name of the business update function as the to-be-updated business function corresponding to the business update function.

5. The method of claim 1, wherein, The identifier is a function coordinate; the to-be-updated business function corresponding to the business update function is obtained according to the identifier, comprising: According to a second correspondence relationship between function coordinates in the function pool and the to-be-updated business function, a to-be-updated business function matching the function coordinate of the business update function is obtained, and the to-be-updated business function matching the function coordinate of the business update function is taken as a to-be-updated business function corresponding to the business update function.

6. The method of claim 1, wherein, The method further includes: During the application update process, if an exception occurs, the exception information is recorded in a log file; If the number of exception information in the log file exceeds a preset threshold, an alarm is sent or a message of the exception is sent.

7. The method of claim 6, wherein, The exception information includes: failure to obtain the value of the first field, failure to modify the value of the first field, and failure to replace the to-be-updated business function with the business update function.

8. The method of claim 1, wherein, The method further includes: During the process of calling the business update function, if the business update function cannot be obtained, a preset rule is used for processing; the preset rule includes: re-calling the business update function, and recording an error.

9. The method of claim 1, wherein, The method further includes: If there are multiple business update functions, the update order of each business update function is determined according to the time stamp of each business update function reaching the application; The update order of each business update function is obtained according to the update order of each business update function.

10. An application program updating apparatus characterized by comprising: The apparatus includes: The first obtaining module is configured to, in response to an update request instruction for an application, obtain a business update function of the application and an identifier associated with the business update function included in the update request instruction; the identifier is used to indicate a to-be-updated business function corresponding to the business update function. The first modifying module is configured to obtain a value of a first field corresponding to the business update function, and modify the value of the first field to a first value; the first value is used to indicate that the to-be-updated business function is in an un-callable state. The replacing module is configured to, according to the identifier, obtain a to-be-updated business function corresponding to the business update function, and replace the to-be-updated business function with the business update function. The second modifying module is configured to modify the value of the first field to a second value; the second value is used to indicate that the business update function is in a callable state; and the second value is different from the first value. The ending module is configured to complete the update of the application after the to-be-updated business functions corresponding to all the business update functions are replaced. The apparatus further includes: The second obtaining module is configured to obtain a value of a second field; the second field is used to indicate the current write permission of the function pool. a third modification module, configured to modify the value of the second field into a fourth value if the value of the second field is a third value; the third value is used to represent that the service update function can be written into the function pool; the fourth value is used to represent that service update functions other than the service update function included in the update request instruction cannot be written into the function pool; and the fourth value is different from the third value; a fourth modification module, configured to modify the value of the second field into the third value.

11. An electronic device, comprising: a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions being executed by the processor to implement the steps of the method according to any one of claims 1 to 9.

12. A readable storage medium, characterized by, The readable storage medium has a program or instructions stored thereon, the program or instructions being executed by a processor to implement the steps of the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Program updating method and device

    CN115640037A

  • Function replacement method, readable storage medium, program product and electronic equipment

    CN118057299A