Redis cache data processing method and device for distributed transaction rollback

CN115686760BActive Publication Date: 2026-07-24E-SURFING DIGITAL LIFE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
E-SURFING DIGITAL LIFE TECH CO LTD
Filing Date
2022-11-15
Publication Date
2026-07-24

Smart Images

  • Figure CN115686760B_ABST
    Figure CN115686760B_ABST
Patent Text Reader

Abstract

The application provides a redis cache data processing method and device for distributed transaction rollback, the method comprises the following steps: acquiring each branch transaction; wherein the branch transaction refers to a branch transaction under Seata AT mode distributed transaction management, and each branch transaction uses redis as cache management; judging whether each branch transaction is a Seata transaction; when each branch transaction is a Seata transaction, judging whether each branch transaction involves a redis modification operation; if yes, performing redis data processing and redis data backup on the Seata transaction; when the business processing of any branch transaction fails, receiving a rollback request; and processing the redis cache data in each branch transaction according to a preconfigured rollback scheme. The method avoids dirty data of the redis cache from affecting subsequent business processing, and greatly improves the security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of IT and software development technology, specifically to a method and apparatus for processing Redis cached data with distributed transaction rollback. Background Technology

[0002] With the rapid development of internet technology and the fast growth of network service users, distributed cluster deployment schemes are commonly used to meet user needs and better serve users. Therefore, distributed transaction scenarios may be involved in the use of services.

[0003] Currently, Seata is widely used as a distributed transaction solution. Seata provides users with AT and TCC modes. The AT mode is based on a relational database that supports local ACID transactions, but it does not support distributed transaction management using Redis as a cache. For example, if some transactions in a distributed system succeed and cache data is saved to Redis, and then a transaction in another distributed service fails, all transactions, including those of other services, need to be rolled back. In this case, rollback logs automatically generate compensation operations, completing the data rollback in the database. However, the data already saved to Redis is not rolled back, making it stale and affecting the accuracy of system service data processing. Therefore, when using Seata's AT mode, how to enable rollback processing in both relational databases and Redis for distributed transaction management is a problem that needs to be solved. Summary of the Invention

[0004] In view of this, this application provides a method and apparatus for processing Redis cached data with distributed transaction rollback.

[0005] In a first aspect, embodiments of this application provide a method for processing Redis cached data with distributed transaction rollback, the method comprising:

[0006] Retrieve each branch transaction; wherein the branch transaction refers to the branch transaction under the Seata AT mode distributed transaction management, and each branch transaction uses Redis as a cache management;

[0007] Determine whether each branch transaction is a Seata transaction;

[0008] When each of the branch transactions is a Seata transaction, determine whether each of the branch transactions involves modification operations on Redis;

[0009] If so, perform Redis data backup and Redis data processing sequentially for the Seata transaction;

[0010] If the business processing of any of the branch transactions fails, a rollback request is received.

[0011] The Redis cached data in each branch transaction is processed according to the pre-configured rollback scheme.

[0012] Secondly, embodiments of this application provide a Redis cache data processing apparatus for distributed transaction rollback, the apparatus comprising:

[0013] The transaction acquisition module is used to acquire each branch transaction; wherein the branch transaction refers to the branch transaction under the Seata AT mode distributed transaction management, and each branch transaction uses Redis as a cache management;

[0014] The global transaction judgment module is used to determine whether each branch transaction is a Seata transaction;

[0015] The modification operation judgment module is used to determine whether each branch transaction involves modification operations on Redis when each branch transaction is a Seata transaction.

[0016] The backup processing module is used to perform Redis data backup and Redis data processing on the Seata transaction in sequence when each of the branch transactions involves Redis modification operations.

[0017] The request receiving module is used to receive a rollback request when the business processing of any of the branch transactions fails.

[0018] The rollback processing module is used to process the Redis cached data in each branch transaction according to a pre-configured rollback scheme.

[0019] Thirdly, embodiments of this application provide a terminal device, including: a memory; one or more processors coupled to the memory; and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the Redis cached data processing method for distributed transaction rollback provided in the first aspect above.

[0020] Fourthly, embodiments of this application provide a computer-readable storage medium storing program code, which can be called by a processor to execute the Redis cache data processing method for distributed transaction rollback provided in the first aspect above.

[0021] The present application provides a method, apparatus, terminal device, and computer-readable storage medium for processing Redis cached data during distributed transaction rollback. The method includes: firstly, acquiring each branch transaction; wherein the branch transaction refers to a branch transaction under the Seata AT mode distributed transaction management, and each branch transaction uses Redis as cache management; determining whether each branch transaction is a Seata transaction; if each branch transaction is a Seata transaction, then determining whether each branch transaction involves modification operations on Redis; if so, performing Redis data backup and Redis data processing sequentially on the Seata transaction; when the business processing of any branch transaction fails, receiving a rollback request; and processing the Redis cached data in each branch transaction according to a pre-configured rollback scheme.

[0022] The Redis cache data processing method for distributed transaction rollback provided in this embodiment processes the Redis cache data when the business processing of a Seata transaction fails and data needs to be rolled back, so as to avoid the dirty data in the Redis cache from affecting subsequent business processing and greatly improve its security. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0024] Figure 1 A schematic diagram illustrating an application scenario of the Redis cached data processing method for distributed transaction rollback provided in this application embodiment;

[0025] Figure 2 A flowchart illustrating a distributed transaction rollback method for processing Redis cached data according to an embodiment of this application;

[0026] Figure 3 A schematic diagram of the Redis cache data processing flow for distributed transaction rollback provided in yet another embodiment of this application;

[0027] Figure 4 This is a schematic diagram of the structure of a Redis cache data processing device for distributed transaction rollback provided in one embodiment of this application;

[0028] Figure 5 This is a schematic diagram of the structure of a terminal device provided in one embodiment of this application;

[0029] Figure 6This is a schematic diagram of the structure of a computer-readable storage medium provided in one embodiment of this application. Detailed Implementation

[0030] The technical solutions in the embodiments of this application will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0031] To provide a more detailed description of this application, the following description, in conjunction with the accompanying drawings, details a distributed transaction rollback method, apparatus, terminal device, and computer-readable storage medium for processing Redis cached data, as provided in this application.

[0032] Please refer to Figure 1 , Figure 1 This illustration shows an application scenario of the Redis cache data processing method for distributed transaction rollback provided in this application embodiment. The application scenario includes the terminal device 100 provided in this application embodiment. The terminal device 100 can be various electronic devices with a display screen (such as structural diagrams 102, 104, 106, and 108), including but not limited to smartphones and computer devices. The computer device can be at least one of desktop computers, portable computers, laptop computers, tablet computers, etc. The terminal device can install and run applications for processing Redis cache data for distributed transaction rollback, as well as for obtaining business data types and conversion relationships between business data types. Users can set relevant information for Redis cache data processing for distributed transaction rollback, such as business data types, on the visual interface of the terminal device 100. The terminal device 100 can obtain the information set by the user and obtain the Redis cache data processing parameters for distributed transaction rollback based on the obtained information. The terminal device 100 can refer to one of multiple terminal devices; this embodiment only uses terminal device 100 as an example. Those skilled in the art will understand that the number of terminal devices can be more or less. For example, there may be only a few terminal devices, or there may be dozens, hundreds, or even more terminal devices. This application embodiment does not limit the number or type of terminal devices. Terminal device 100 can be used to execute a distributed transaction rollback Redis cache data processing method provided in this application embodiment.

[0033] In one optional implementation, the application scenario may include not only the terminal device 100 provided in this embodiment, but also a server, wherein a network is established between the server and the terminal device. The network serves as a medium for providing a communication link between the terminal device and the server. The network may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0034] It should be understood that the number of terminal devices, networks, and servers is merely illustrative. Depending on implementation needs, there can be any number of terminal devices, networks, and servers. For example, the servers can be a server cluster composed of multiple servers. The terminal devices interact with the servers through the network to receive or send messages, etc. The servers can provide various services. The servers can be used to execute the steps of the distributed transaction rollback Redis cache data processing method provided in this application embodiment. Furthermore, when executing the distributed transaction rollback Redis cache data processing method provided in this application embodiment, some steps can be executed on the terminal device and some steps can be executed on the server; this is not limited here.

[0035] In Seata's AT mode distributed transaction management, there are multiple branch transactions, and one or more of these branch transactions use Redis as a cache. When the business processing of a branch transaction fails, a rollback operation needs to be performed on all branch transactions. At this time, after each branch transaction receives the rollback notification from TC (Seata Transaction Coordinator), directly rolling back could easily lead to dirty data in the Redis cache.

[0036] Based on this, this application provides a method for handling Redis cached data with distributed transaction rollback in its embodiments. Please refer to... Figure 2 , Figure 2 This illustration shows a flowchart of a distributed transaction rollback Redis cache data processing method provided in an embodiment of this application, demonstrating the application of this method in... Figure 1 Taking a terminal device as an example, the explanation includes the following steps:

[0037] Step S110: Obtain transactions for each branch.

[0038] Branch transactions refer to branch transactions under the Seata AT mode distributed transaction management, where each branch transaction uses Redis as a cache management mechanism.

[0039] Step S120: Determine whether each branch transaction is a Seata transaction.

[0040] In one embodiment, determining whether each branch transaction is a Seata transaction includes: obtaining the global transaction identifier in each branch transaction; when the global transaction identifiers in each branch transaction are the same, determining that each branch transaction belongs to a Seata transaction.

[0041] Specifically, it can be determined whether each branch transaction is a Seata transaction based on the global transaction identifier XID. When the global transaction identifier XIDs of each branch transaction are the same, it means that each branch transaction is a Seata transaction.

[0042] Step S130: When each branch transaction is a Seata transaction, determine whether each branch transaction involves modification operations on Redis.

[0043] In one embodiment, determining whether each branch transaction involves modification operations on Redis includes: determining whether each branch transaction involves adding, deleting, or reducing operations on Redis.

[0044] Specifically, when each branch transaction is determined to be a Seata transaction, it is determined whether each branch transaction involves Redis insert, delete, or Delete operations. If such operations are involved, the Redis cached data will change from the original data (i.e., the data before the transaction execution) during the transaction execution. If the business processing of a certain transaction fails, directly rolling back the Redis cached data will generate dirty data. Dirty data refers to data in the source system that is outside the given range, has no meaning for the actual business, has an illegal data format, or contains non-standard coding and ambiguous business logic in the source system.

[0045] Step S140: If yes, perform Redis data backup and Redis data processing sequentially for the Seata transaction.

[0046] Based on this, if each branch transaction is determined to be a Seata transaction, and the branch transaction involves modification operations on Redis, then the Redis data involved in the Seata transaction needs to be backed up first, and then the Redis data involved in the Seata transaction is processed after the backup.

[0047] Step S150: When the business processing of any branch transaction fails, a rollback request is received.

[0048] Step S160: Process the Redis cached data in each branch transaction according to the pre-configured rollback scheme.

[0049] Specifically, there are two main pre-planned rollback schemes: one is a Redis cache data clearing scheme, and the other is a Redis cache data recovery scheme. The Redis cache data clearing scheme refers to clearing the Redis cache data in the transaction during transaction rollback, and the data needed later is retrieved from the database again; the Redis cache data recovery scheme refers to restoring the Redis cache data from the Redis backup data to the data before the transaction was executed.

[0050] Here, Redis cached data refers to the data cached by the Redis manager during the execution of a transaction.

[0051] The Redis cache data processing method for distributed transaction rollback provided in this embodiment processes Redis cache data when Seata transaction business processing fails and data rollback is required. This prevents dirty data in the Redis cache from affecting subsequent business processing, greatly improving its security. Furthermore, this method also ensures the consistency of Redis cached data.

[0052] Next, several implementation methods for handling Redis cached data during transaction rollback are given, described in detail below:

[0053] In one embodiment, the Redis cached data in each branch transaction is processed according to a pre-configured rollback scheme, including: clearing the Redis cached data in each branch transaction.

[0054] Specifically, a Redis cache data clearing scheme can be used to process Redis cache data, that is, to clear the Redis cache data in each branch of the transaction when the transaction is rolled back, thereby avoiding the generation of dirty data during the rollback.

[0055] In one embodiment, the Redis cached data in each branch transaction is processed according to a pre-configured rollback scheme, including: restoring the Redis cached data in each branch transaction to the data before the execution of the branch transaction based on the Redis backup data.

[0056] Specifically, a Redis cache data recovery scheme can be used to process Redis cache data. That is, when rolling back a transaction, the Redis cache data in each branch of the corresponding transaction is updated to the data before the transaction was executed based on the Redis backup data, thereby avoiding the generation of dirty data during the rollback.

[0057] In one embodiment, after processing the Redis cached data in each branch transaction according to the pre-configured rollback scheme, the method further includes: clearing the Redis backup data.

[0058] In one embodiment, the method further includes: clearing the Redis backup data when the business processing of each branch transaction is successfully executed.

[0059] Specifically, after the rollback is completed, or when the business processing of each branch transaction is successfully executed, the Redis backup data can be cleared to free up memory space.

[0060] To facilitate understanding of this solution, a specific embodiment is provided. Please refer to [link / reference]. Figure 3 As shown. The specific steps are as follows: 1. The system service receives a purchase request. The service is configured with a Redis cache data clearing scheme for rollback. The business processing is to generate a purchase order and reduce the inventory of one product. Before using Redis, it first checks whether the current transaction is a Seata transaction. If it is, it proceeds to the next step; otherwise, it does not process this Redis transaction.

[0061] 2. In step 1 above, it is determined that the current transaction is a Seata transaction. At this time, the inventory quantity of the product in the database is updated. For example, if the inventory quantity is changed from "2" to "1", the Redis cache also needs to be modified. After backing up the cache data before the modification, the product inventory quantity is modified again.

[0062] 3. Waiting for the TC (Seata Transaction Coordinator) result notification, the payment service failed, and the branch transaction received a rollback notification. Since the Redis rollback scheme is a Redis cache data clearing scheme, upon receiving the rollback notification, the Redis cache data for the product quantity is cleared. The relational database rollback is unaffected; its product record quantity is restored to its original value of "2". The next query finds no product quantity data in the cache and retrieves the product quantity from the database, resulting in "2". If the Redis cache for this product quantity had not been cleared, the returned product quantity result would have been "1", thus resolving the issue of dirty Redis cache data. Alternatively, if the service is configured with a Redis cache data recovery scheme, the current Redis cache value for the product quantity will be restored from "1" to the backup value of "2".

[0063] 4. After step 3, all backup data in the transaction can be cleaned up to free up storage space for the service.

[0064] It should be understood that, although Figure 2 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise explicitly stated in this document, there is no strict order in which these steps are executed; they can be performed in other orders. Figure 2At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0065] The embodiments disclosed in this application describe in detail a Redis cache data processing method for distributed transaction rollback. The above-disclosed method can be implemented using various types of devices. Therefore, this application also discloses a Redis cache data processing device for distributed transaction rollback corresponding to the above method. Specific embodiments are given below for detailed description.

[0066] Please see Figure 4 This application discloses a distributed transaction rollback Redis cache data processing device, which mainly includes:

[0067] The transaction acquisition module 410 is used to acquire each branch transaction; the branch transaction refers to the branch transaction under the Seata AT mode distributed transaction management, and each branch transaction uses Redis as a cache management;

[0068] The global transaction judgment module 420 is used to determine whether each branch transaction is a Seata transaction.

[0069] The modification operation judgment module 430 is used to determine whether each branch transaction involves modification operations on Redis when each branch transaction is a Seata transaction.

[0070] The backup processing module 440 is used to perform Redis data backup and Redis data processing sequentially on the Seata transaction when each branch transaction involves Redis modification operations.

[0071] The request receiving module 450 is used to receive a rollback request when the business processing of any branch transaction fails.

[0072] The rollback processing module 460 is used to process the Redis cached data in each branch transaction according to the pre-configured rollback scheme.

[0073] In one embodiment, the global transaction determination module 420 is used to obtain the global transaction identifier in each branch transaction; when the global transaction identifiers in each branch transaction are the same, it is determined that each branch transaction belongs to a Seata transaction.

[0074] In one embodiment, the modification operation judgment module 430 is used to determine whether each branch transaction involves adding, deleting, or reducing operations on Redis.

[0075] In one embodiment, the rollback processing module 460 is used to clear the Redis cached data in each branch transaction.

[0076] In one embodiment, the rollback processing module 460 is used to restore the Redis cached data in each branch transaction to the data before the branch transaction was executed, based on the Redis backup data.

[0077] In one embodiment, the apparatus further includes a cleanup processing module for cleaning up Redis backup data.

[0078] In one embodiment, the clearing processing module is used to clear the Redis backup data when the business processing of each branch transaction is successfully executed.

[0079] Specific limitations regarding the Redis cache data processing device for distributed transaction rollback can be found in the method limitations section above, and will not be repeated here. Each module in the aforementioned device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in the terminal device, or stored in software within the terminal device's memory, so that the processor can invoke and execute the corresponding operations of each module.

[0080] Please refer to Figure 5 , Figure 5 This illustration shows a structural block diagram of a terminal device provided in an embodiment of this application. The terminal device 50 can be a computer device. The terminal device 50 in this application may include one or more of the following components: a processor 52, a memory 54, and one or more application programs, wherein the one or more application programs can be stored in the memory 54 and configured to be executed by the one or more processors 52, and the one or more application programs are configured to execute the methods described in the above embodiments of the Redis cache data processing method applied to distributed transaction rollback.

[0081] Processor 52 may include one or more processing cores. Processor 52 connects to various parts within the terminal device 50 using various interfaces and lines, and performs various functions and processes data of the terminal device 50 by running or executing instructions, programs, code sets, or instruction sets stored in memory 54, and by calling data stored in memory 54. Optionally, processor 52 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). Processor 52 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into processor 52 and may be implemented separately using a communication chip.

[0082] The memory 54 may include random access memory (RAM) or read-only memory (ROM). The memory 54 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 54 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the various method embodiments described below. The data storage area may also store data created by the terminal device 50 during use.

[0083] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the terminal device to which the present application is applied. A specific terminal device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0084] In summary, the terminal device provided in this application embodiment is used to implement the corresponding distributed transaction rollback Redis cache data processing method in the foregoing method embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0085] Please see Figure 6This diagram illustrates a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. The computer-readable storage medium 60 stores program code, which can be called by a processor to execute the method described in the above embodiment of the distributed transaction rollback Redis cache data processing method.

[0086] The computer-readable storage medium 60 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 60 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 60 has storage space for program code 62 that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code 62 may be compressed, for example, in a suitable form.

[0087] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0088] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for processing Redis cached data with distributed transaction rollback, characterized in that, The method includes: Retrieve each branch transaction; wherein the branch transaction refers to the branch transaction under the Seata AT mode distributed transaction management, and each branch transaction uses Redis as a cache management; Determine whether each branch transaction is a Seata transaction; When each of the branch transactions is a Seata transaction, determine whether each of the branch transactions involves modification operations on Redis; If so, perform Redis data backup and Redis data processing sequentially for the branch transactions; If any of the branch transactions fails to process Redis data, a rollback request is received. The Redis cached data in each branch transaction is processed according to the pre-configured rollback scheme.

2. The method according to claim 1, characterized in that, The determination of whether each branch transaction is a Seata transaction includes: Obtain the global transaction identifier in each of the branch transactions; When the global transaction identifiers in all the branch transactions are the same, it is determined that each of the branch transactions belongs to a Seata transaction.

3. The method according to claim 1, characterized in that, The determination of whether each branch transaction involves modification operations on Redis includes: Determine whether each branch transaction involves adding, deleting, or reducing operations on Redis.

4. The method according to any one of claims 1-3, characterized in that, The process of processing the Redis cached data in each branch transaction according to the pre-configured rollback scheme includes: Clear the Redis cached data in each of the aforementioned branch transactions.

5. The method according to any one of claims 1-3, characterized in that, The process of processing the Redis cached data in each branch transaction according to the pre-configured rollback scheme includes: Based on the Redis backup data, restore the Redis cached data in each branch transaction to the data before the execution of the branch transaction.

6. The method according to any one of claims 1-3, characterized in that, After processing the Redis cached data in each branch transaction according to the pre-configured rollback scheme, the process further includes: Clear the Redis backup data.

7. The method according to any one of claims 1-3, characterized in that, The method further includes: When the Redis data processing for each of the aforementioned branch transactions is executed successfully, the Redis backup data is cleared.

8. A Redis cache data processing device with distributed transaction rollback, characterized in that, The device includes: The transaction acquisition module is used to acquire each branch transaction; wherein the branch transaction refers to the branch transaction under the Seata AT mode distributed transaction management, and each branch transaction uses Redis as a cache management; The global transaction judgment module is used to determine whether each branch transaction is a Seata transaction; The modification operation judgment module is used to determine whether each branch transaction involves modification operations on Redis when each branch transaction is a Seata transaction. The backup processing module is used to perform Redis data backup and Redis data processing sequentially on each of the branch transactions when each of the branch transactions involves Redis modification operations. The request receiving module is used to receive a rollback request when the Redis data processing of any of the branch transactions fails. The rollback processing module is used to process the Redis cached data in each branch transaction according to a pre-configured rollback scheme.

9. A terminal device, characterized in that, include: Memory; One or more processors are coupled to the memory; One or more applications, wherein the one or more applications are stored in memory and configured to be executed by one or more processors, and the one or more applications are configured to perform the method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium contains program code that can be invoked by a processor to execute the method as described in any one of claims 1-7.