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

By obtaining and replacing business update functions in application updates, the downtime and system overhead problems caused by traditional update methods are solved, and efficient and continuous application updates are achieved.

CN119739403AActive Publication Date: 2025-04-01GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 4 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Traditional application update methods require application downtime and all business functions to be deployed, resulting in increased system overhead and reduced business continuity, affecting the user experience.

Method used

By obtaining the application's business update function and its associated identifier, obtaining the business function to be updated based on the identifier and replacing it with the business update function, the application update is completed without restarting the application.

Benefits of technology

Reduces system overhead, improves business continuity, and reduces the delay of business update function calls, without requiring application restart.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739403A_ABST
    Figure CN119739403A_ABST
Patent Text Reader

Abstract

The invention provides an application program updating method and device, electronic equipment and a readable storage medium, and the method comprises the steps: responding to an updating request instruction for an application program, and obtaining a service updating function of the application program and an identifier associated with the service updating function, which are included in the updating request instruction; obtaining a numerical value of a first field corresponding to the service updating function, and modifying the numerical value of the first field into a first numerical value; according to the identifier, obtaining a to-be-updated service function corresponding to the service updating function, and replacing the to-be-updated service function with the service updating function; modifying the numerical value of the first field into a second numerical value; after the to-be-updated service functions corresponding to all the service updating functions are replaced, updating of the application program is completed. The system overhead can be reduced, the time delay of service updating function calling can be reduced, and the service continuity is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer technology, and specifically relates to an application updating method, device, electronic device and readable storage medium. Background Art

[0002] As technology advances and market demands change, applications need to be constantly updated to fix known issues or optimize performance and to meet market challenges and opportunities.

[0003] The traditional way to update an application is to shut down the application after receiving an update request instruction, then redeploy all required business functions on the application when the application is updated, and restart the application.

[0004] Traditional application update methods often require application downtime and deployment of all business functions, which not only increases system overhead but also reduces business continuity and is not conducive to user experience. Summary of the invention

[0005] The present application aims to provide an application updating method, device, electronic device and readable storage medium, which at least solves the problem in the prior art that the application needs to be shut down and all business functions 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 embodiment of the present application discloses a method for updating an application program, the method comprising:

[0007] In response to an update request instruction for an application, obtaining a service update function of the application included in the update request instruction and an identifier associated with the service update function; the identifier is used to indicate a service function to be updated corresponding to the service update function;

[0008] Acquire a value of a first field corresponding to the service update function, and modify the value of the first field to a first value; the first value is used to indicate that the service function to be updated is in an uncallable state;

[0009] According to the identifier, obtaining a to-be-updated service function corresponding to the service update function, and replacing the to-be-updated service function with the service update function;

[0010] Modify the value of the first field to a second value; the second value is used to indicate that the service update function is in a callable state; the second value is a value different from the first value;

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

[0012] In a second aspect, an embodiment of the present application discloses an application updating device, the device comprising:

[0013] A first acquisition module, configured to, in response to an update request instruction for an application, acquire a service update function of the application included in the update request instruction and an identifier associated with the service update function; the identifier is used to indicate a service function to be updated corresponding to the service update function;

[0014] A first modification module is used to obtain a value of a first field corresponding to the service update function, and to modify the value of the first field to a first value; the first value is used to indicate that the service function to be updated is in an uncallable state;

[0015] A replacement module, configured to obtain, according to the identifier, a to-be-updated service function corresponding to the service update function, and replace the to-be-updated service function with the service update function;

[0016] A second modification module, used to modify the value of the first field to a second value; the second value is used to indicate that the service update function is in a callable state; the second value is a value different from the first value;

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

[0018] In a third aspect, an embodiment of the present application further discloses an electronic device, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0019] In a fourth aspect, an embodiment of the present application further discloses a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0020] In summary, in an embodiment of the present application, a business update function of an application and an identifier associated with the business update function are obtained, and based on the identifier, a to-be-updated business function corresponding to the business update function is obtained, and the to-be-updated business function is replaced with the business update function. After all to-be-updated business functions corresponding to all business update functions are replaced, the update of the application is completed, instead of redeploying all business functions required when the application is updated on the application. Therefore, 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, 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 the second value, so that the business update function is in a callable state. There is no need to restart the application and call the business update function after restarting the application. Instead, 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 delay of calling the business update function can be reduced, and the continuity of the business is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In the attached picture:

[0022] Figure 1 is a flowchart of a method for updating an application program provided in an embodiment of the present application;

[0023] Figure 2 is a flowchart of another method for updating an application program provided in an embodiment of the present application;

[0024] Figure 3 is a flowchart of the steps of another application updating method provided by an embodiment of the present application;

[0025] Figure 4 is a block diagram of an application updating device provided in an embodiment of the present application;

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

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

[0028] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this 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 interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0030] As business grows and changes, applications need to be frequently updated to introduce new features, fix known issues, or optimize performance. Application update refers to the process of patching and improving applications. Application updates can fix vulnerabilities in applications and improve application performance and stability.

[0031] The traditional application update method is to shut down the application after receiving the update request instruction, then redeploy all the business functions required for the application update on the application and restart the application. The traditional application update method often requires the application to be shut down, which will have a negative impact on business continuity 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 an embodiment of the present application, a business update function of an application and an identifier associated with the business update function are obtained, and based on the identifier, a to-be-updated business function corresponding to the business update function is obtained, and the to-be-updated business function is replaced with the business update function. After all to-be-updated business functions corresponding to all business update functions are replaced, the update of the application is completed, instead of redeploying all business functions required when updating the application on the application. Therefore, 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, 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 the second value, so that the business update function is in a callable state. There is no need to restart the application. Instead, 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 delay of calling the business update function can be reduced, and the continuity of the business is improved.

[0033] Figure 1 This is a flowchart of a method for updating an application program provided in an embodiment of the present application. Figure 1 , the method may include the following steps:

[0034] Step 101: In response to an update request instruction for an application, obtain 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 business function to be updated corresponding to the business update function.

[0035] For example, update request instructions are used to obtain the latest data, information, or status. Whether in software applications, online services, or database management systems, they all play an important role in ensuring that users can obtain accurate and real-time information. For example, in a software application, when the developer releases a new version, the user may receive a prompt asking whether to update the application. When the user clicks the "Update" button, a signal is sent that an update has been requested, and the system will begin downloading and installing the latest version of the application.

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

[0037] For example, the business update function can also be called a new function, and the business update function can be a method code block, which processes the parameters in the method code block by passing in parameters, and then outputs the processing results. For example, the business function can be a blackcall function.

[0038] For example, the identifier can be information anchored to the business function to be updated, used to indicate the business function to be updated corresponding to the business update function. Specifically, the identifier can also be used to locate the memory area of ​​the business function to be updated, so that the business function to be updated is replaced with the business update function in the memory area of ​​the business function to be updated.

[0039] Step 102: Obtain a value of a first field corresponding to the service update function, and modify the value of the first field to a first value; the first value is used to indicate that the service function to be updated is in an uncallable state.

[0040] For example, the value of the first field corresponds to the service update function one by one, and each service update function has a value of the first field.

[0041] For example, the first field may be a sign field, and the first value may 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 will be locked, and external programs cannot obtain the business function to be updated.

[0042] For example, the present application obtains the value of the first field corresponding to the business update function and modifies the value of the first field to the first value, thereby avoiding external programs from calling the business function to be updated when the business function to be updated is updated, ensuring the safe release of the business function to be updated and the correct loading of the business update function.

[0043] Step 103: Obtain a to-be-updated service function corresponding to the service update function according to the identifier, and replace the to-be-updated service function with the service update function.

[0044] For example, the identifier may be information anchored to the business function to be updated. Based on the identifier, the business function to be updated may be queried, so that the business function to be updated may be replaced with the business update function in the memory area where the business function to be updated is located. For example, the identifier may be name=blackCall, the identifier may be index=16, and the identifier may also be name=blackCall, index=16.

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

[0046] Step 104: modify the value of the first field to a second value; the second value is used to indicate that the service update function is in a callable state; the second value is a value 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 business function to be updated has been replaced by the business update function, the update is completed, the business function to be updated will be unlocked, and the external program can call the business update function and execute the business update function.

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

[0049] For example, in the process of replacing a business function to be updated with a business update function, the present application can ensure the safe release of the business function to be updated and the correct loading of the business update function by modifying the value of the first field corresponding to the business update function.

[0050] For example, after replacing the business function to be updated with the business update function, the value of the first field corresponding to the business update function is changed to the second value, i.e., 0, so that the business update function is in a callable state. An external program can call the business update function and execute the business update function without restarting the application program and calling the business update function again after restarting. Therefore, the latency of calling the business update function can be reduced and the continuity of the business can be improved.

[0051] Step 105: After all the service functions to be updated corresponding to the service update functions are replaced, the application is updated.

[0052] For example, after all the business functions to be updated are replaced with the corresponding business update functions, the application update is completed.

[0053] For example, assuming that the number of business update functions is 3, after replacing the business function 1 to be updated corresponding to business update function 1 with business update function 1, replacing the business function 2 to be updated corresponding to business update function 2 with business update function 2, and replacing the business function 3 to be updated corresponding to business update function 3 with business update function 3, the update of the application is completed.

[0054] In summary, in an embodiment of the present application, a business update function of an application and an identifier associated with the business update function are obtained, and based on the identifier, a to-be-updated business function corresponding to the business update function is obtained, and the to-be-updated business function is replaced with the business update function. After all to-be-updated business functions corresponding to all business update functions are replaced, the update of the application is completed, instead of redeploying all business functions required when the application is updated on the application. Therefore, 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, 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 the second value, so that the business update function is in a callable state. There is no need to restart the application, but the update status 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 delay of calling the business update function can be reduced, and the continuity of the business is improved.

[0055] Figure 2 This is a flowchart of another method for updating an application provided by this application. Figure 2 The method may include the following steps:

[0056] Step 201: In response to an update request instruction for an application, obtain 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 business function to be updated corresponding to the business update function.

[0057] This step may refer to the above step 101 and will not be described in detail here.

[0058] Optionally, step 201 may specifically include:

[0059] Sub-step 2011: If there are multiple business update functions, determine the update order of each business update function according to the timestamp when each business update function arrives at the application.

[0060] Sub-step 2012: Acquire the service update function and an identifier associated with the service update function according to the update order of each service update function.

[0061] For sub-steps 2011-2012, taking the number of business update functions as 3 as an example, if the time when business update function 1 reaches the application is earlier than that of business update function 3, and the time when business update function 3 reaches the application is earlier than that of business update function 2, then first, business update function 1 is updated, then business update function 3 is updated, and finally, business update function 2 is updated. And in accordance with the update order of business update function 1, business update function 3, and business update function 2, business update function 1 and an identifier associated with business update function 1 are first obtained, and then business update function 3 and an identifier associated with business update function 3, business update function 2 and an identifier associated with business update function 2 are obtained.

[0062] Step 202: Obtain a value of a first field corresponding to the service update function, and modify the value of the first field to a first value; the first value is used to indicate that the service function to be updated is in an uncallable state.

[0063] This step may refer to the above step 102 and will not be described in detail here.

[0064] Step 203: According to the identifier, obtain the to-be-updated business function corresponding to the business update function, and obtain the memory area of ​​the to-be-updated business function in the function pool; the to-be-updated business function is stored in the function pool.

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

[0066] For example, the function pool may store function names and business functions to be updated. The business function to be updated that has the same function name as the business update function is obtained through the function name of the business update function, and the business function to be updated that has the same function name as the business update function is used as the business function to be updated corresponding to the business update function.

[0067] For example, the function pool may also store function coordinates and business functions to be updated. The function coordinates refer to putting the business function to be updated into the function set, recording the sequence coordinates of the business function to be updated in the function set, obtaining the business function to be updated with the same function coordinates as the business update function through the function coordinates, and taking the business function to be updated with the same function coordinates as the business update function as the business function to be updated corresponding to the business update function.

[0068] For example, the memory area of ​​the business function to be updated in the function pool is obtained according to the identifier, that is, according to the identifier, the business function to be updated related to the identifier can be anchored, so that the position of the business function to be updated in the function pool can be obtained.

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

[0070] Sub-step 2031: According to the first correspondence between the function name in the function pool and the business function to be updated, obtain the business function to be updated that matches the function name of the business update function, and use the business function to be updated that matches the function name of the business update function as the business function to be updated corresponding to the business update function.

[0071] For example, the function pool stores function names and business functions to be updated. After obtaining the business update function, the business function to be updated in the function pool that matches the function name of the business update function is obtained, that is, the business function to be updated corresponding to the business update function.

[0072] For example, the function name is blackcall, that is, the identifier is name=blackcall, and the to-be-updated business function with the function name of blackcall in the function pool is used as the to-be-updated business function corresponding to the business update function.

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

[0074] Sub-step 2032: According to the second correspondence between the function coordinates in the function pool and the business function to be updated, obtain the business function to be updated that matches the function coordinates of the business update function, and use the business function to be updated that matches the function coordinates of the business update function as the business function to be updated corresponding to the business update function.

[0075] For example, the function pool stores function coordinates and business functions to be updated. After obtaining the business update function, the business function to be updated in the function pool that matches the function coordinates of the business update function is obtained, that is, the business function to be updated corresponding to the business update function.

[0076] For example, the function coordinate is 16, that is, the identifier is index=16, and the to-be-updated business function with the function coordinate of 16 in the function pool is used as the to-be-updated business function corresponding to the business update function.

[0077] For example, the function pool stores function names, function coordinates, and business functions to be updated. After obtaining the business update function, the business function to be updated in the function pool that matches the function name and function coordinates of the business update function is obtained, which is the business function to be updated 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, and the to-be-updated business function with the function name of blackcall and the function coordinate of 16 in the function pool is used as the to-be-updated business function corresponding to the business update function.

[0079] Step 204: Delete the service function to be updated, and write the service update function into the memory area where the service function to be updated is located.

[0080] For example, the present application deletes the business function to be updated and writes the business update function into the memory area where the business function to be updated is deleted, thereby replacing the business function to be updated with the business update function. This achieves seamless replacement of the business function to be updated with the business update function, ensuring efficient operation and stability of the application.

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

[0082] Step A1, obtain the value of the 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 the third value, the value of the second field is modified to a fourth value; the third value is used to represent that the business update function can be written into the function pool; the fourth value is used to represent that the business update functions included in the update request instruction, except for the business update function, cannot be written 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: modify the value of the second field to the third value.

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

[0087] Get the value of the second field. If the value of the second field is 0, it means that the business update function can be written into the function pool. Change the value of the second field to 1, delete the business function to be updated, and write the business update function into the memory area where the business function to be updated is located. Then, change the value of the second field to 0, so that the business functions to be updated corresponding to other business update functions can be updated. This application obtains the value of the second field and determines whether there is write permission according to the value of the second field. The implementation method is relatively simple.

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

[0089] Optionally, the method further includes:

[0090] Step A4: If the value of the second field is the fourth value, add the business update function to the waiting queue and reacquire the value of the second field until the value of the second field is the third value, and then enter the step of modifying the value of the second field to the fourth value.

[0091] For example, taking the third value being 0 and the fourth value being 1 as an example, if the value of the second field is 1, it means that the business update function currently does not have write permission. The business update function is added to the waiting queue, and the value of the second field is obtained again until the value of the second field is 0, indicating that the business update function currently has write permission and can write to the function pool. The value of the second field is modified to 1, and the business function to be updated is deleted. The business update function is written to the memory area where the business function to be updated is located. After that, the value of the second field is modified to 0 so that the business functions to be updated 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 indicate that the service update function is in a callable state; the second value is different from the first value.

[0093] For example, after deleting the business function to be updated and writing the business update function in the memory area where the business function to be updated is located, 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, and the external program can call the business update function and execute the business update function. There is no need to restart the application program, and then call the business update function after restarting. Therefore, the latency of calling the business update function can be reduced and the continuity of the business can be improved.

[0094] Step 206: After all the service functions to be updated corresponding to the service update functions are replaced, the application is updated.

[0095] For example, taking the number of business update functions as 3 and the update order as update business update function 1, update business update function 3, and update business update function 2 as an example, after replacing the business function 1 to be updated corresponding to business update function 1 with business update function 1, replace the business function 3 to be updated corresponding to business update function 3 with business update function 3, and finally, replace the business function 2 to be updated corresponding to business update function 2 with business update function 2. After that, the update of the application is completed.

[0096] Optionally, the method further includes:

[0097] Step 207: If an exception occurs during the application update process, the exception information is recorded in a log file.

[0098] Step 208: If the amount of abnormal information in the log file exceeds a preset threshold, an alarm or an abnormal message is issued.

[0099] Optionally, the abnormal 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 business function to be updated with the business update function.

[0100] For step 207-step 208, during the application update process, if there are exceptions such as failure to obtain the value of the first field, failure to modify the value of the first field, failure to replace the business function to be updated with the business update function, etc., these exception information will be recorded in the log file.

[0101] Taking the preset threshold value of 10 as an example, an alarm is issued or an abnormal message is issued when the number of abnormal information in the log file exceeds 10. Of course, an alarm or an abnormal message can also be issued when abnormal information appears.

[0102] Optionally, the method further includes:

[0103] Step 209: During the process of calling the service update function, if the service update function cannot be obtained, processing is performed according to preset rules; the preset rules include: re-calling the service update function and recording an error.

[0104] For example, during the process of calling the service update function, if the service update function cannot be obtained, the service update function can be called again.

[0105] For example, during the process of calling the service update function, if the service update function cannot be obtained, an error may be recorded, that is, a record is made that the service update function cannot be obtained.

[0106] In an embodiment of the present application, a business update function of an application and an identifier associated with the business update function are obtained, and based on the identifier, a to-be-updated business function corresponding to the business update function is obtained, and the to-be-updated business function is replaced with the business update function. After all to-be-updated business functions corresponding to all business update functions are replaced, the update of the application is completed, instead of redeploying all business functions required when updating the application on the application. Therefore, 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, 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 the second value, so that the business update function is in a callable state. There is no need to restart the application. Instead, 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 delay of calling the business update function can be reduced, and the continuity of the business is improved.

[0107] See also Figure 3 , which shows a flowchart of the steps of another application updating method provided by an embodiment of the present application, specifically comprising:

[0108] S1. Responding to an update request instruction, obtaining a service update function;

[0109] S2, obtaining the value of the second field, determining whether the value of the second field is the third value, if the value of the second field is not the third value, executing step S3, if the value of the second field is the third value, executing step S4;

[0110] S3, the service update function joins the waiting queue, and re-obtains the value of the second field, and executes step S2;

[0111] S4, modifying the value of the second field to a fourth value;

[0112] S5. Replace the service function to be updated with the service update function;

[0113] S6. Modify the value of the second field to a third value;

[0114] S7. Call the service update function and execute the service update function.

[0115] In an embodiment of the present application, a business update function of an application and an identifier associated with the business update function are obtained, and based on the identifier, a to-be-updated business function corresponding to the business update function is obtained, and the to-be-updated business function is replaced with the business update function. After all to-be-updated business functions corresponding to all business update functions are replaced, the update of the application is completed, instead of redeploying all business functions required when updating the application on the application. Therefore, 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, 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 the second value, so that the business update function is in a callable state. There is no need to restart the application. Instead, 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 delay of calling the business update function can be reduced, and the continuity of the business is improved.

[0116] See also Figure 4 , which shows an application updating device 30 provided in an embodiment of the present application, the application updating device 30 includes:

[0117] A first acquisition module 301 is used to, in response to an update request instruction for an application, acquire a service update function of the application included in the update request instruction and an identifier associated with the service update function; the identifier is used to indicate a service function to be updated corresponding to the service update function;

[0118] A first modification module 302 is used to obtain a value of a first field corresponding to the service update function, and modify the value of the first field to a first value; the first value is used to indicate that the service function to be updated is in an uncallable state;

[0119] A replacement module 303 is used to obtain a to-be-updated service function corresponding to the service update function according to the identifier, and replace the to-be-updated service function with the service update function;

[0120] A second modification module 304 is used to modify the value of the first field to a second value; the second value is used to indicate that the service update function is in a callable state; the second value is a value different from the first value;

[0121] End module 305 is used to complete the update of the application after all the service functions to be updated corresponding to the service update functions are replaced.

[0122] Optionally, the business function to be updated is stored in a function pool; the replacement module 303 includes:

[0123] A first acquisition submodule is used to acquire the memory slice of the to-be-updated business function in the function pool;

[0124] The processing submodule is used to delete the business function to be updated and write the business update function into the memory area where the business function to be updated is located.

[0125] Optionally, the device further comprises:

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

[0127] a third modification module, 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 indicate that the service update function can be written into the function pool; the fourth value is used to indicate that the service update function included in the update request instruction, except for the service update function, cannot be written into the function pool; the fourth value is a value different from the third value;

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

[0129] Optionally, the device further comprises:

[0130] The third acquisition module is used to add the business update function to the waiting queue and re-acquire the value of the second field if the value of the second field is the fourth value, until the value of the second field is the third value, and then enter the step of modifying the value of the second field to the fourth value.

[0131] Optionally, the identifier is a function name; and the replacement module includes:

[0132] The second acquisition submodule is used to obtain the business function to be updated that matches the function name of the business update function according to the first corresponding relationship between the function name in the function pool and the business function to be updated, and use the business function to be updated that matches the function name of the business update function as the business function to be updated corresponding to the business update function.

[0133] Optionally, the identifier is a function coordinate; and the replacement module includes:

[0134] The third acquisition submodule is used to obtain the business function to be updated that matches the function coordinates of the business update function according to the second corresponding relationship between the function coordinates in the function pool and the business function to be updated, and use the business function to be updated that matches the function coordinates of the business update function as the business function to be updated corresponding to the business update function.

[0135] Optionally, the device further comprises:

[0136] The recording module is used to record the exception information in the log file if an exception occurs during the application update process;

[0137] The sending module is used to issue an alarm or an abnormal message if the amount of abnormal information in the log file exceeds a preset threshold.

[0138] Optionally, the abnormal 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 business function to be updated with the business update function.

[0139] Optionally, the device further comprises:

[0140] The processing module is used to process according to preset rules if the business update function cannot be obtained during the process of calling the business update function; the preset rules include: re-calling the business update function and recording errors.

[0141] Optionally, the first acquisition module includes:

[0142] A determination submodule, configured to determine, if there are multiple business update functions, an update order of each business update function according to a timestamp when each business update function arrives at the application program;

[0143] The fourth acquisition submodule is used to acquire the service update function and an identifier associated with the service update function according to the update order of each service update function.

[0144] In an embodiment of the present application, a business update function of an application and an identifier associated with the business update function are obtained, and based on the identifier, a to-be-updated business function corresponding to the business update function is obtained, and the to-be-updated business function is replaced with the business update function. After all to-be-updated business functions corresponding to all business update functions are replaced, the update of the application is completed, instead of redeploying all business functions required when updating the application on the application. Therefore, 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, 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 the second value, so that the business update function is in a callable state. There is no need to restart the application. Instead, 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 delay of calling the business update function can be reduced, and the continuity of the business is improved.

[0145] See also Figure 5 , the electronic device 400 may include one or more of the following components: a processing component 402 , a memory 404 , a power 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 generally controls the overall operation of the electronic device 400, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 402 may include one or more modules to facilitate the interaction between the processing component 402 and other components. For example, the processing component 402 may 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 such data include instructions for any application or method operating on the electronic device 400, contact data, phone book data, messages, pictures, multimedia, etc. The memory 404 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, 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 memory, flash memory, magnetic disk or optical disk.

[0148] The power supply component 406 provides power to the various components of the electronic device 400. The power supply component 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 400.

[0149] The multimedia component 408 includes an interface that provides an output interface between the electronic device 400 and the user. In some embodiments, the interface may include a liquid crystal display (LCD) and a touch panel (TP). If the interface includes a touch panel, the interface may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front camera and / or a rear camera. When the electronic device 400 is in an operating mode, such as a shooting mode or a multimedia mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

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

[0151] The input / output I / O interface 412 provides an interface between the processing component 402 and the peripheral interface module, which may be a keyboard, a click wheel, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0152] The sensor assembly 414 includes one or more sensors for providing various aspects of status assessment for the electronic device 400. For example, the sensor assembly 414 can detect the open / closed state of the electronic device 400, the relative positioning of components, such as the display and keypad of the electronic device 400, and the sensor assembly 414 can also detect the position change 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 of the electronic device 400, and the temperature change of the electronic device 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 414 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0153] The communication component 416 is used 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 carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 416 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 also includes 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) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0154] In an exemplary embodiment, the electronic device 400 may be implemented by 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, microcontrollers, microprocessors or other electronic components to implement an application update method provided in an embodiment of the present application.

[0155] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 404 including instructions, and the instructions can be executed by a processor 420 of an electronic device 400 to perform the above 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 disk, an optical data storage device, etc.

[0156] Figure 6is a block diagram of an electronic device 500 according to another embodiment of the present invention. For example, the electronic device 500 may be provided as a server. Figure 6 , 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 that can be executed by the processing component 522, such as an application. The application stored in the memory 532 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 522 is configured to execute instructions to perform an application update method provided in an embodiment of the present application.

[0157] The electronic device 500 may also include a power supply 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 may 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] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the application disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0159] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A method for updating an application, characterized in that: The method comprises: In response to an update request instruction for an application, obtaining a service update function of the application included in the update request instruction and an identifier associated with the service update function; the identifier is used to indicate a service function to be updated corresponding to the service update function; Acquire a value of a first field corresponding to the service update function, and modify the value of the first field to a first value; the first value is used to indicate that the service function to be updated is in an uncallable state; According to the identifier, obtaining a to-be-updated service function corresponding to the service update function, and replacing the to-be-updated service function with the service update function; Modify the value of the first field to a second value; the second value is used to indicate that the service update function is in a callable state; the second value is a value different from the first value; After all the service functions to be updated corresponding to the service update functions are replaced, the update of the application is completed.

2. The method according to claim 1, characterized in that The business function to be updated is stored in the function pool; The replacing the to-be-updated service function with the service update function comprises: Obtain the memory slice of the business function to be updated in the function pool; The business function to be updated is deleted, and the business update function is written into the memory area where the business function to be updated is located.

3. The method according to claim 1, characterized in that Before replacing the to-be-updated service function with the service update function, the method further includes: Get the value of the second field; the second field is used to indicate the current write permission of the function pool; If the value of the second field is the third value, the value of the second field is modified to a fourth value; the third value is used to indicate that the service update function can be written into the function pool; the fourth value is used to indicate that the service update function other than the service update function included in the update request instruction cannot be written into the function pool; the fourth value is a value different from the third value; After replacing the to-be-updated service function with the service update function, the method further includes: The value of the second field is modified to the third value.

4. The method according to claim 3, characterized in that The method further comprises: 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.

5. The method according to claim 1, characterized in that The identifier is a function name; The obtaining, according to the identifier, a to-be-updated service function corresponding to the service update function comprises: According to the first correspondence between the function name in the function pool and the business function to be updated, the business function to be updated that matches the function name of the business update function is obtained, and the business function to be updated that matches the function name of the business update function is used as the business function to be updated corresponding to the business update function.

6. The method according to claim 1, characterized in that The identifier is a function coordinate; The obtaining, according to the identifier, a to-be-updated service function corresponding to the service update function comprises: According to the second correspondence between the function coordinates in the function pool and the business function to be updated, the business function to be updated that matches the function coordinates of the business update function is obtained, and the business function to be updated that matches the function coordinates of the business update function is used as the business function to be updated corresponding to the business update function.

7. The method according to claim 1, characterized in that The method further comprises: During the application update process, if an exception occurs, the exception information will be recorded in the log file; If the amount of abnormal information in the log file exceeds a preset threshold, an alarm or an abnormal message is issued.

8. The method according to claim 7, characterized in that The abnormal 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.

9. The method according to claim 1, characterized in that: The method further comprises: In the process of calling the service update function, if the service update function cannot be obtained, processing is performed according to preset rules; the preset rules include: re-calling the service update function and recording an error.

10. The method according to claim 1, characterized in that The step of obtaining, in response to an update request instruction for an application, a service update function of the application included in the update request instruction and an identifier associated with the service update function, comprises: If there are multiple business update functions, determining the update order of each business update function according to the timestamp when each business update function arrives at the application; According to the update order of each of the service update functions, the service update function and an identifier associated with the service update function are obtained.

11. An application updating device, characterized in that: The device comprises: A first acquisition module, configured to, in response to an update request instruction for an application, acquire a service update function of the application included in the update request instruction and an identifier associated with the service update function; the identifier is used to indicate a service function to be updated corresponding to the service update function; A first modification module is used to obtain a value of a first field corresponding to the service update function, and to modify the value of the first field to a first value; the first value is used to indicate that the service function to be updated is in an uncallable state; A replacement module, configured to obtain, according to the identifier, a to-be-updated service function corresponding to the service update function, and replace the to-be-updated service function with the service update function; A second modification module, used to modify the value of the first field to a second value; the second value is used to indicate that the service update function is in a callable state; the second value is a value different from the first value; The ending module is used to complete the update of the application program after all the business functions to be updated corresponding to the business update functions are replaced.

12. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method according to any one of claims 1 to 10 are implemented.

13. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.

Citation Information

Patent Citations

  • Application updating method and device, computer equipment and storage medium

    CN114138294A

  • Program updating method and device

    CN115640037A

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

    CN118057299A

  • Automated backward-compatible function updates

    US10620937B1