Service data processing method and device of application program, equipment and medium
By detecting the application stage in the cross-end application framework and transferring data to the temporary storage unit during the startup stage, the blocking problem caused by the differences between the asynchronous interface and the synchronous interface is solved, and the development efficiency and stability of the application are improved.
Patent Information
- Application Number
- CN202311054643.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-21
- Publication Date
- 2024-11-15
AI Technical Summary
Applications developed with existing cross-end application frameworks are difficult to achieve true cross-end use, resulting in low development efficiency and poor application stability, mainly due to the blocking problems caused by the differences in asynchronous application programming interfaces and synchronous application programming interfaces.
By detecting the stage of the target application, the cross-end application framework using the asynchronous application programming interface obtains business data from the persistent storage unit and stores it to the temporary storage unit at the startup stage, and handles data reading and writing through synchronous calls during the running stage. Request to avoid blocking of persistent storage units.
It improves the cross-end development efficiency and operation stability of the application, reduces the probability of application crash or abnormal termination, and realizes cross-end code consistency and reusability.
Smart Images

Figure CN118963864A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of application technology, and in particular to a method, device, equipment and medium for processing business data of an application. Background Art
[0002] At present, with the rapid development of information technology, related applications have gradually been integrated into people's lives, providing people with a variety of services. Traditional application development usually requires writing different codes for each platform, which leads to duplication of work, high application development costs and difficult maintenance.
[0003] In the related art, there is a cross-end development method, that is, developing applications based on a cross-end application framework. The cross-end application framework can support building applications in a single code base and running them on multiple platform terminals at the same time. By sharing code and resources, it can improve the development efficiency and code reusability of applications. However, in actual applications, it is found that there are differences between the application programming interfaces used by some platform terminals and the application programming interface types supported by the cross-end application framework, which makes it difficult for applications developed based on the cross-end application framework to truly achieve cross-end use, affecting the development efficiency of the application.
[0004] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the invention
[0005] The embodiments of the present application provide a method, apparatus, device and medium for processing business data of an application program, which can implement synchronous calls on an application program developed by a cross-end application framework using an asynchronous application programming interface, facilitate cross-end development of the application program, and help improve the operating stability of the application program.
[0006] An aspect of an embodiment of the present application provides a method for processing business data of an application program, the method comprising:
[0007] Detecting the stage of a target application; wherein the target application is developed using a cross-end application framework, and the cross-end application framework implements business data processing based on an asynchronous application programming interface;
[0008] When the target application is in the startup phase, querying and acquiring the business data corresponding to the target application from the persistent storage unit, and storing the business data in the temporary storage unit;
[0009] When the target application is in the running stage, in response to a data read request, first data is read from the temporary storage unit by means of a synchronous call; or, in response to a data write request, second data is received and the second data is written to the temporary storage unit by means of a synchronous call; wherein the business data includes the first data.
[0010] On the other hand, an embodiment of the present application provides a device for processing business data of an application, the device comprising:
[0011] A detection unit, used to detect the stage of a target application; wherein the target application is developed using a cross-end application framework, and the cross-end application framework implements business data processing based on an asynchronous application programming interface;
[0012] A transfer unit, used for querying and acquiring the business data corresponding to the target application from the persistent storage unit when the target application is in the startup phase, and storing the business data in the temporary storage unit;
[0013] A read-write unit is used to respond to a data read request and read first data from the temporary storage unit by means of a synchronous call when the target application is in the running stage; or, respond to a data write request, receive second data and write the second data to the temporary storage unit by means of a synchronous call; wherein the business data includes the first data.
[0014] Optionally, the device further includes a trigger unit, and the trigger unit is specifically used to:
[0015] Detecting a touch screen operation of a target object on a terminal device, and triggering the target application to enter a startup phase according to the touch screen operation;
[0016] Alternatively, voice data of the target object is acquired, voice recognition is performed on the voice data, and the target application is triggered to enter a startup phase according to a result of the voice recognition.
[0017] Optionally, the transfer unit is specifically used for:
[0018] When the target application is in the startup phase, parsing the configuration file of the target application to determine the persistent storage path of the business data corresponding to the target application;
[0019] According to the persistent storage path, the business data corresponding to the target application is queried and acquired from the persistent storage unit.
[0020] Optionally, the transfer unit is specifically used for:
[0021] When the target application is in the startup phase, obtaining key value information of business data corresponding to the target application;
[0022] According to the key value information, query the address information of the business data in the persistent storage unit;
[0023] The business data corresponding to the target application is acquired according to the address information, and the business data is stored in the temporary storage unit by asynchronous calling.
[0024] Optionally, the device further includes a second writing unit, wherein the second writing unit is specifically configured to:
[0025] copying the second data;
[0026] The copied second data is written into the persistent storage unit by means of an asynchronous call.
[0027] Optionally, the target application runs based on at least two containers; and the transfer unit is specifically used for:
[0028] Determine a temporary storage unit pre-allocated to each of the containers; wherein each of the containers corresponds to one temporary storage unit;
[0029] The business data is stored in a temporary storage unit corresponding to each container.
[0030] Optionally, the at least two containers include a first container and a second container, the temporary storage unit includes a first temporary storage unit and a second temporary storage unit, the first container corresponds to the first temporary storage unit, and the second container corresponds to the second temporary storage unit; the device further includes a storage processing unit, and the storage processing unit is specifically used to:
[0031] detecting the operating status of the first container;
[0032] If the first container is in the foreground running state, detecting whether the business data corresponding to the target application stored in the persistent storage unit changes during the process in which the first container is in the foreground running state;
[0033] If the business data corresponding to the target application stored in the persistent storage unit changes, when the first container switches from the foreground running state to the background running state, the target data is extracted from the persistent storage unit; the target data is the business data corresponding to the target application stored in the persistent storage unit at the switching time node;
[0034] The target data is stored in the second temporary storage unit.
[0035] Optionally, the at least two containers include a first container and a second container, the temporary storage unit includes a first temporary storage unit and a second temporary storage unit, the first container corresponds to the first temporary storage unit, and the second container corresponds to the second temporary storage unit; the device further includes a storage processing unit, and the storage processing unit is specifically used to:
[0036] detecting an operating status of the second container;
[0037] If the second container is in the background running state, detecting whether the business data corresponding to the target application stored in the persistent storage unit changes during the process in which the second container is in the background running state;
[0038] If the business data corresponding to the target application stored in the persistent storage unit changes, when the second container switches from the background running state to the foreground running state, the target data is extracted from the persistent storage unit; the target data is the business data corresponding to the target application stored in the persistent storage unit at the switching time node;
[0039] The target data is stored in the second temporary storage unit.
[0040] Optionally, the device further includes a sequence processing unit, and the sequence processing unit is specifically configured to:
[0041] Serializing the target data to obtain a target character string;
[0042] Deserialize the target string to obtain the target data;
[0043] The data currently stored in the second temporary storage unit is cleared, and the target data is written into the cleared second temporary storage unit.
[0044] Optionally, the device further includes a variable processing unit, and the variable processing unit is specifically used to:
[0045] Storing the target character string in a predetermined variable;
[0046] The target string is deserialized based on the variable, and after the deserialization of the target string is completed, the variable is left empty.
[0047] Optionally, the device further comprises a clearing unit, wherein the clearing unit is specifically configured to:
[0048] When the target application is in the destruction phase, the data currently stored in the temporary storage unit is cleared.
[0049] On the other hand, an embodiment of the present application provides an electronic device, including a processor and a memory;
[0050] The memory is used to store computer programs;
[0051] The processor executes the computer program to implement the business data processing method of the aforementioned application program.
[0052] On the other hand, an embodiment of the present application provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is executed by a processor to implement the business data processing method of the aforementioned application program.
[0053] The embodiment of the present application further discloses a computer program product, including a computer program, which implements the business data processing method of the aforementioned application program when executed by a processor.
[0054] The embodiments of the present application include at least the following beneficial effects: The present application provides a method, apparatus, device and medium for processing business data of an application. The scheme detects the stage of a target application, and the target application is developed by using a cross-end application framework using an asynchronous application programming interface. When the target application is in the startup stage, the business data corresponding to the target application is queried from the persistent storage unit, and the business data is transferred to a temporary storage unit. When the target application is in the running stage, for both data read requests and data write requests, the request processing is implemented based on the temporary storage unit through synchronous calls, which can facilitate the cross-end development of the application. Moreover, since the request is processed by the temporary storage unit in the present scheme, the blocking problem of the persistent storage unit can be alleviated, and the probability of application crash or abnormal termination can be reduced, which is conducive to improving the running stability of the application. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The accompanying drawings are used to provide further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.
[0056] Figure 1 A schematic diagram of an implementation environment of a business data processing method of an application provided in an embodiment of the present application;
[0057] Figure 2 A flowchart of a business data processing method for an application provided in an embodiment of the present application;
[0058] Figure 3 A schematic diagram of an interface of a terminal device provided in an embodiment of the present application;
[0059] Figure 4 A schematic diagram of a page of a video playback application provided in an embodiment of the present application;
[0060] Figure 5 A schematic diagram of a page displaying content contained in a first container provided in an embodiment of the present application;
[0061] Figure 6 A schematic diagram of a page displaying content contained in a second container provided in an embodiment of the present application;
[0062] Figure 7 A schematic diagram of loading local persistent data of a mobile terminal from a disk into a memory provided in an embodiment of the present application;
[0063] Figure 8 A schematic diagram of performing a dual write operation and a read operation on data provided in an embodiment of the present application;
[0064] Fig. 9 A schematic diagram of data synchronization between multiple containers provided in an embodiment of the present application;
[0065] Fig.10 A schematic diagram of the structure of a business data processing device for an application provided in an embodiment of the present application;
[0066] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0067] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.
[0068] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".
[0069] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.
[0070] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0071] Before describing the embodiments of the present application in detail, some nouns and terms involved in the embodiments of the present application are first described. The nouns and terms involved in the embodiments of the present application are subject to the following explanations.
[0072] 1) Cross-platform application framework: A development framework that helps developers build applications on multiple different platforms without having to write application code separately for each platform.
[0073] 2) Application Programming Interface (API), a set of specifications and conventions that define how different application components interact with each other. The API can be seen as a bridge for communication and data exchange between different applications.
[0074] 3) Synchronous Call: A calling method in which after calling a function or method, the caller will wait for the called function or method to complete execution and return a result before continuing to execute subsequent code. In a synchronous call, the caller will block and wait for the called function to execute until the called function returns a result or times out.
[0075] 4) Asynchronous Call: A calling method in which the caller does not wait for the called function to complete execution after calling a function or method, but returns immediately and continues to execute subsequent code. The called function is executed in another thread or event loop, and notifies the caller after completion, usually through a callback function, Promise object or event mechanism to process the return result.
[0076] 5) JSI (JavaScript Interface), a technology that allows two-way communication between JavaScript and native code, is essentially a memory mapping library based on C++. Based on JSI, C++ objects can be called directly to achieve synchronous call processing of data.
[0077] 6) hippy framework, a cross-end application framework based on React Native, provides an efficient, flexible and scalable way to develop mobile applications.
[0078] 7) Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer and application service layer. Blockchain can include public chain, alliance chain and private chain. Among them, public chain refers to a blockchain that anyone can enter the blockchain network at any time to read data, send data or compete for accounting; alliance chain refers to a blockchain jointly managed by several organizations or institutions; private chain refers to a blockchain with certain centralized control. The write right of the private chain account book is controlled by a certain organization or institution, and the access and use of data are strictly managed by permissions.
[0079] At present, with the rapid development of information technology, related applications have gradually been integrated into people's lives, providing people with a variety of services. After the application is developed, it often needs to be deployed to different platforms. The traditional application development method usually requires writing different codes for each platform, which will lead to duplication of work, high application development costs and difficult maintenance.
[0080] In the related art, there is a cross-end development method, that is, developing applications based on a cross-end application framework. The cross-end application framework can support building applications in a single code base and running them on multiple platform terminals at the same time. By sharing code and resources, it can improve the development efficiency and code reusability of applications. However, in actual applications, it is found that there are differences between the application programming interfaces used by some platform terminals and the application programming interface types supported by the cross-end application framework, which makes it difficult for applications developed based on the cross-end application framework to truly achieve cross-end use, affecting the development efficiency of the application.
[0081] For example, some platform terminals may only provide synchronous application programming interfaces and support synchronous calls to implement business data processing. However, some applications developed using cross-end application frameworks are difficult to use across terminals because the cross-end application frameworks implement business data processing based on asynchronous application programming interfaces. In related technologies, JSI (JavaScript Interface) is used to perform compatibility processing on the calling methods of applications developed using cross-end application frameworks, which can help achieve consistency in multi-end application code and reduce the cost of application code development. However, this method is based on synchronous calls to read and write business data on disk, which is prone to serious blocking problems. In some platforms with poor performance or business scenarios with frequent data storage calls, application crashes or abnormal terminations often occur, resulting in poor stability of the application and affecting the user experience.
[0082] In view of this, an embodiment of the present application provides a method, device, equipment and medium for processing business data of an application. The scheme detects the stage of a target application, which is developed by a cross-end application framework using an asynchronous application programming interface. When the target application is in the startup stage, the business data corresponding to the target application is queried from the persistent storage unit, and the business data is transferred to a temporary storage unit. When the target application is in the running stage, for both data read requests and data write requests, the request processing is implemented based on the temporary storage unit through synchronous calls, which can facilitate the cross-end development of the application. Moreover, since the request is processed by the temporary storage unit in this scheme, the blocking problem of the persistent storage unit can be alleviated, the probability of application crash or abnormal termination can be reduced, and it is beneficial to improve the running stability of the application.
[0083] The business data processing method of the application provided in the embodiment of the present application mainly relates to the technology related to the application in the field of information technology. It can be understood by those skilled in the art that the business data processing method of the application provided in the embodiment of the present application can be executed in various application scenarios:
[0084] For example, in some embodiments, the method of the present application can be applied in an e-commerce application, which can be used to process orders, payments, inventory and logistics management, etc. For example, after receiving an order request for an object, the e-commerce application can verify whether the inventory is sufficient, calculate the order amount, generate a payment request, and update the inventory and order status.
[0085] Exemplarily, in some embodiments, the method of the present application can be applied in a social media application, which can support functions such as registration, login, content publishing and commenting of the target object, and provide a variety of social services for the target object.
[0086] For example, in some embodiments, the method of the present application can be applied to a hotel reservation application, which can include functions such as searching for hotels, selecting rooms, booking and paying. For example, when a target object searches for a hotel, the application can retrieve hotel information that meets the conditions from a database according to the target object's search conditions, and return the results to the target object.
[0087] It is understandable that the above application scenarios are only exemplary and do not limit the actual application of the business data processing method of the application in the embodiment of the present application. Those skilled in the art can understand that in different application scenarios, the business data processing method of the application provided in the embodiment of the present application can be used to perform specified tasks.
[0088] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on the object's information, the object's behavioral data, the object's historical data, the object's location information, and other data related to the object's identity or characteristics, the object's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with the relevant laws, regulations, and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain sensitive information of the object, the object's separate permission or separate consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the object's separate permission or separate consent, the necessary object-related data for the normal operation of the embodiment of the present application will be obtained.
[0089] The specific implementation of the embodiment of the present application is described in detail below in conjunction with the accompanying drawings. First, a business data processing method of an application provided in the embodiment of the present application is described in conjunction with the accompanying drawings.
[0090] Please refer to Figure 1 , Figure 1The schematic diagram of the implementation environment of a business data processing method of an application provided in an embodiment of the present application is shown. In the implementation environment, the main software and hardware entities involved include a terminal device 110 and a background server 120.
[0091] Specifically, the terminal device 110 may be installed with a relevant application, and the background server 120 is the background server of the application. The terminal device 110 and the background server 120 are connected in communication. The application service data processing method provided in the embodiment of the present application may be executed on the terminal device 110 side.
[0092] Among them, the terminal device 110 of the above embodiment may include a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, but is not limited thereto.
[0093] The backend server 120 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It may also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.
[0094] In addition, the backend server 120 may also be a node server in the blockchain network.
[0095] The terminal device 110 and the backend server 120 may establish a communication connection through a wireless network or a wired network. The wireless network or wired network uses standard communication technology and / or protocols, and the network may be set to the Internet, or any other network, such as but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a private network or any combination of a virtual private network. Moreover, the above-mentioned software and hardware entities may use the same communication connection mode or different communication connection modes, and this application does not impose any specific restrictions on this.
[0096] Of course, it is understandable that Figure 1 The implementation environment in the embodiment of the present application is only some optional application scenarios of the business data processing method of the application program provided in the embodiment of the present application. The actual application is not fixed. Figure 1The method provided in the embodiment of the present application can be applied to various technical fields, such as shopping, games, social networking and other fields, and the present application does not make any specific limitation on this.
[0097] Below, in combination with the above description of the implementation environment, a business data processing method of an application provided in an embodiment of the present application is introduced and explained in detail.
[0098] like Figure 2 As shown, in the embodiment of the present application, a business data processing method of an application is provided, and the business data processing method of the application can be applied to Figure 1 In the terminal device 110 shown. Figure 2 The business data processing method of the application provided in the embodiment of the present application specifically includes but is not limited to steps 210 to 230:
[0099] Step 210: Detect the stage of the target application; wherein the target application is developed using a cross-end application framework, and the cross-end application framework implements business data processing based on an asynchronous application programming interface;
[0100] In the embodiment of the present application, the application can run on different platform terminals and is a cross-terminal application. Among them, the application that needs to be processed for calling mode compatibility on the specified platform terminal can be recorded as a target application. It can be understood that the target application is the program version of the cross-terminal application under a certain (or certain) specified platform terminal. In addition to the version corresponding to the target application, the cross-terminal application can also include versions that can run on other platform terminals.
[0101] It is understandable that in the embodiments of the present application, there is no restriction on the type of platform end on which the application is specifically deployed. For example, in some embodiments, the platform end may include a desktop end, on which desktop applications using operating systems such as Windows and Mac OS can be run; in some embodiments, the platform end may include a mobile end, on which mobile applications using mobile operating systems such as iOS and Android can be run; in some embodiments, the platform end may include a web page (Web) end, on which applications can be run based on various browsers; in some embodiments, the platform end may include a mini-program end, on which various lightweight applications based on host applications, i.e., mini-programs, can be run. These mini-programs are also a form of deployment of applications. In the embodiments of the present application, there is no restriction on the specific type of host applications.
[0102] Of course, it should be noted that the introduction of the platform end provided in the above embodiments is only used for exemplary purposes and does not mean to limit the actual platform end type. The specific platform end type can be flexibly set as needed. For example, the mobile end can further subdivide the platform end type into iOS end and Android end according to the type of operating system running; for example, the platform end can also include vehicle-mounted end, TV end, etc., that is, the application can be deployed on a vehicle-mounted host or run on a smart TV, and this application does not limit this.
[0103] For example, for a certain cross-end application, it can be applied on the mobile end and the mini-program end. Among them, due to the limitations of the host application, only a synchronous application programming interface is provided on the mini-program end, which supports synchronous calls to realize the processing of business data. On the mobile end, the application is developed and deployed using a cross-end application framework, which implements business data processing based on an asynchronous application programming interface. In order to make the cross-end application program consistent on the mobile end and the mini-program end, it is necessary to perform call compatibility processing on the mobile end application, that is, to implement synchronous calls on the target application developed using the cross-end application framework using the asynchronous application programming interface.
[0104] In this step, when processing the business data of the target application, the stage of the target application can be detected. Here, for the application, its running process generally includes the launching stage (Launching), running stage (Running), paused stage (Paused), stopped stage (Stopped) and destroyed stage (Destroyed).
[0105] Specifically, the process of the startup phase includes: when the target object starts the application, the system will create the application process and allocate resources, and then execute the application startup code to perform initialization operations. After the application is started, it enters the running phase. The application in the running phase can respond to the operation of the target object and execute the corresponding business logic. It can also apply for resources from the system or trigger native events. When the target object leaves the application or switches to another application, the system will put the application in a suspended state, that is, suspend the application process. In this case, the application will enter the suspended phase. The suspended phase will not destroy the application process, but will temporarily retain it because the target object may return to the application interface again. When the system resources are insufficient or the target object forcibly closes the application, the application will enter the stop phase, that is, the system will terminate most of the application processes and release resources, but within a certain period of time, the system may retain the application status information so that the target object can quickly restore to the previous state when it is started again next time. After the application enters the stop phase for a certain period of time, if the target object does not start the application again, it will enter the destruction phase. At this time, all the status information of the application will be cleared, including temporary files, memory cache, etc. When the application is started next time, all data needs to be reloaded and initialized.
[0106] Of course, it can be understood that the introduction of the stages included in the running process of the application in the above embodiments is only for exemplary purposes. The specific number of stages, stage names, business logic corresponding to each stage, and conditions for entering each stage can be flexibly adjusted according to actual needs, and this application does not impose any restrictions on this.
[0107] In this step, the stage of the target application is detected, and there may be multiple specific implementation methods. Exemplarily, in some embodiments, the operating status and the stage of the target application can be determined by analyzing the log file of the target application. For example, the stage of the target application can be determined by checking specific log information or events. In some embodiments, the stage of the target application can be inferred by detecting key indicators related to the target application, such as memory utilization, CPU (Central Processing Unit) utilization, request response time, etc. For example, in the startup phase, the CPU utilization and memory utilization of the target application may be high, and the stage of the target application can be detected based on these characteristics. In some embodiments, a timer or stage marker can be inserted in the key code block or stage process of the target application to record the time and stage of code execution. Based on the timer or stage marker, the stage of the target application can be detected.
[0108] It can be understood that the above embodiments are only used to exemplify the detection method of the stage of the target application. In actual applications, any one or more of the methods can be selected to implement the detection of the stage of the target application, and this application does not impose any restrictions on this.
[0109] Step 220: When the target application is in the startup phase, query and obtain the business data corresponding to the target application from the persistent storage unit, and store the business data in the temporary storage unit;
[0110] In this step, the stage of the target application is detected. When it is determined that the target application is in the startup stage, the preparatory work for the call mode compatibility processing can be performed. Specifically, in the embodiment of the present application, on the one hand, it is necessary to implement synchronous calling to achieve cross-terminal development and deployment of the target application; on the other hand, it is hoped that the operations of reading and writing disks can be reduced as much as possible when performing synchronous calling, thereby reducing the probability of application crash or abnormal termination and improving the running stability of the application.
[0111] In view of the above requirements, in this step, when the target application is in the startup phase, the business data corresponding to the target application can be queried from the persistent storage unit, and the business data can be stored in the temporary storage unit. Here, the persistent storage unit is used to store persistent data, and persistent data refers to data that needs to be persisted during the operation of the application so that the previous state can be restored when the application is restarted. Generally speaking, the persistent storage unit can be a disk, but is not limited to this. For example, in some embodiments, the persistent storage unit can also be a solid-state drive (SSD), an optical disk, a network storage device, etc., and this application does not limit this.
[0112] In an embodiment of the present application, the business data corresponding to the target application is queried from the persistent storage unit. The business data refers to the data required to run the target application, which may include all or part of the persistent data corresponding to the target application. Exemplarily, in some embodiments, the business data corresponding to the target application may include object data, configuration data, cache data, etc., wherein the object data may include the personal data, login credentials, permission settings, etc. of the target object; the configuration data may include the configuration information of the target application, such as the server address, API key, configuration of third-party services, etc. The cache data is to improve the performance of the target application and reduce the number of network requests, which may include image cache data, page cache data, etc.
[0113] Of course, it is understood that in the embodiments of the present application, the business data corresponding to the target application may be related to the specific type and function of the target application, and is not limited to the above content. For example, in some embodiments, if the target application involves a transaction function, the business data may include transaction-related data, such as pre-set payment channel information, payment records, etc.
[0114] In this step, the acquired business data can be stored in a temporary storage unit. Here, the temporary storage unit is generally a memory. Storing the business data in the temporary storage unit can facilitate subsequent data read and write operations through synchronous calls, while avoiding the serious blocking problem caused by synchronous reading and writing of the disk (persistent storage unit), which can effectively reduce the probability of application crash or abnormal termination.
[0115] It should be noted that, in the embodiment of the present application, the target application may correspond to an independent memory storage area, which may be allocated by the system during the startup phase of the target application, so that the business data can be conveniently stored in the temporary storage unit later. In addition, the memory storage areas corresponding to different target applications are isolated from each other, so that multiple target applications can be run in parallel.
[0116] Step 230: When the target application is in the running stage, in response to a data read request, first data is read from a temporary storage unit by means of a synchronous call; or, in response to a data write request, second data is received and the second data is written to the temporary storage unit by means of a synchronous call; wherein the business data includes the first data.
[0117] In the embodiment of the present application, during the startup phase of the target application, the business data is stored in a temporary storage unit to complete the preparation work for executing the call mode compatibility processing. During the operation phase of the target application, the synchronous call processing of the business data can be implemented based on the temporary storage unit.
[0118] In this step, when it is determined that the target application is in the running stage, various requests triggered by the target application can be processed, and these requests can be processed by synchronous calling to achieve compatibility processing of the target application calling method. In this way, the same target application code can be executed on the platform side that only provides synchronous application programming interfaces and supports synchronous calling to implement business data processing, or it can be developed and deployed using a cross-end application framework, and the cross-end application framework is based on asynchronous application programming interfaces to implement business data processing on the platform side, which can support the code consistency of the target application and improve the development efficiency and code reusability of the target application.
[0119] Specifically, during the target application running phase, the following types of business logic may be triggered:
[0120] Object request: The target object interacts with the target application through an interface or interface. For example, the target object may need to read relevant data when browsing a web page, and may need to write data when submitting a form. System events: The target application may respond to the triggering of system events, such as timer events, network events, device events, etc. These events may require reading or writing relevant data. Background tasks: The target application may perform some background tasks, such as data processing, data analysis, batch operations, etc. These tasks may require reading or writing data. Therefore, in general, during the running stage of the target application, data read requests or data write requests may be triggered.
[0121] In this step, for the data read request, the target application can read the corresponding data from the temporary storage unit by synchronous calling to meet the request. In the embodiment of the present application, the read data is recorded as the first data, and the first data is a part of the business data. Specifically, the process of the target application responding to the data read request may include: determining the location or path of the data to be read according to the data identifier or parameter in the data read request, and then reading the first data from the temporary storage unit through an appropriate data reading method, and then returning the read first data to the requester of the data read request to complete the read operation.
[0122] In this step, for a data write request, the target application can receive the second data to be written, and write the second data into a temporary storage unit by means of a synchronous call. Specifically, the process of the target application responding to the data write request may include: determining the location or path of the data to be written according to the data identifier or parameter in the data write request, and then writing the second data into the corresponding location of the temporary storage unit. It should be noted here that, in an embodiment of the present application, before writing the second data, the second data may be subjected to data format conversion or other processing, and the present application does not limit this. After confirming that the write operation is completed, the corresponding status or result may be returned to the requester of the data write request.
[0123] It can be understood that the business data processing method of the application provided in the embodiment of the present application detects the stage of the target application, which is developed by using a cross-end application framework using an asynchronous application programming interface. When the target application is in the startup stage, the business data corresponding to the target application is queried from the persistent storage unit and the business data is transferred to the temporary storage unit. When the target application is in the running stage, for both data read requests and data write requests, the request processing is implemented based on the temporary storage unit through synchronous calls, which can facilitate the cross-end development of the application. Moreover, since the request is processed by the temporary storage unit in this solution, the blocking problem of the persistent storage unit can be alleviated, the probability of application crash or abnormal termination can be reduced, and it is beneficial to improve the running stability of the application.
[0124] Specifically, in a possible implementation, the startup phase of the target application is triggered by the following steps:
[0125] Detecting the touch screen operation of the target object on the terminal device, and triggering the target application to enter the startup phase according to the touch screen operation;
[0126] Alternatively, voice data of the target object is obtained, voice recognition is performed on the voice data, and the target application is triggered to enter the startup phase according to the result of the voice recognition.
[0127] In an embodiment of the present application, when it is necessary to start the target application, that is, to trigger the target application to enter the startup phase, the target object can interact with the terminal device and issue a startup instruction for the target application. The terminal device can respond to the startup instruction and trigger the execution of the business logic of running the target application.
[0128] Specifically, in the embodiments of the present application, the target object may be a user of the target application. The specific implementation form of the interaction between the target object and the terminal device and the issuance of the start-up instruction is not limited in the present application. Exemplarily, for example, the terminal device may receive the interaction instruction of the target object to the relevant component and use the interaction instruction as the start-up instruction. Here, the relevant component may be a component configured in the underlying system of the terminal device or a component configured in the target application, and its implementation form may be flexibly set as needed. For example, in some embodiments, the component may be a component with a voice interaction function in the terminal device, which may recognize the voice data of the target object through voice recognition technology. The target object may perform voice interaction with the terminal device, such as saying "turn on the map navigation function" to the terminal device, thereby issuing a start-up instruction for a certain map application. Here, the map application is the target application. The voice recognition algorithm used in the embodiments of the present application may be implemented with reference to the relevant technology, and the present application will not elaborate on this.
[0129] In some embodiments, the component may also be a touch component, for example, referring to Figure 3 , Figure 3 This is a schematic diagram of an interface of a terminal device provided in an embodiment of the present application, such as Figure 3 As shown, a terminal device has multiple applications installed, and icons corresponding to multiple applications are displayed on the screen 310 of the terminal device. At this time, the operation of the target object clicking the icon 311 of the corresponding application on the screen 310 of the terminal device can be regarded as initiating a start instruction for the application, and the application corresponding to the icon 311 is the target application. Of course, it can be understood that in some embodiments, the received operation of the target object touching, sliding, etc. in the designated screen area of the terminal device can also be used as a start instruction for the target application, and this application does not make specific restrictions on this.
[0130] Furthermore, it should be noted that in the embodiments of the present application, the start instruction is not limited to being triggered in the form of real-time interactive operations based on the target object. In some embodiments, it can also be based on the settings of the underlying system of the terminal device, the background server of the application, or the target object, and automatically triggered when certain business logics are met. For example, a target time node can be pre-set for the target application, and then the underlying system can obtain time information in real time. If the current moment reaches the target time node, the start instruction for the target application can be automatically triggered. Of course, it can be understood that the above-mentioned implementation method of automatically triggering the start instruction based on time is only for exemplary description. Those skilled in the art can flexibly set the business logic of the automatic triggering of the start instruction according to actual needs, and this application does not limit this.
[0131] Specifically, in a possible implementation, when the target application is in the startup phase, querying and obtaining the business data corresponding to the target application from the persistent storage unit includes:
[0132] When the target application is in the startup phase, the configuration file of the target application is parsed to determine the persistent storage path of the business data corresponding to the target application;
[0133] According to the persistent storage path, query and obtain the business data corresponding to the target application from the persistent storage unit.
[0134] In an embodiment of the present application, there are multiple ways to query and obtain the business data corresponding to the target application from the persistent storage unit. For example, in some embodiments, when it is determined that the target application is in the startup phase, the configuration file of the target application can be parsed. Here, the target application can use the configuration file to specify the storage location of the business data in the persistent storage unit, and by parsing the configuration file, the path specified in the configuration file, that is, the persistent storage path of the business data, can be read. According to the persistent storage path, the business data corresponding to the target application can be accessed and obtained.
[0135] In some embodiments, the target application may also set the storage location of the business data in the persistent storage unit through command line parameters. Therefore, similarly, when the target application is in the startup phase, the command line parameters corresponding to the target application may be parsed to obtain the specified persistent storage path, and then the persistent storage path may be used to query and obtain the business data.
[0136] Specifically, in a possible implementation, when the target application is in the startup phase, querying and acquiring the business data corresponding to the target application from the persistent storage unit, and storing the business data in the temporary storage unit, includes:
[0137] When the target application is in the startup phase, key value information of the business data corresponding to the target application is obtained;
[0138] According to the key value information, query the address information of the business data in the persistent storage unit;
[0139] The business data corresponding to the target application is obtained according to the address information, and the business data is stored in a temporary storage unit through an asynchronous call.
[0140] In an embodiment of the present application, another implementation method for querying and obtaining the business data corresponding to the target application from the persistent storage unit is also provided. Specifically, in an embodiment of the present application, when storing the business data corresponding to the target application, key information can be used to identify the stored business data. Here, the key information can be a value or a set of values used to uniquely identify the data. The key information and the data it identifies are in a one-to-one correspondence, and the key information corresponding to different data is different. For the business data stored in the above manner, the key information can be used to obtain it when querying and obtaining. For example, the key information of the business data corresponding to the target application can be obtained, and then matching can be performed based on the key information to query the address information of the business data in the persistent storage unit, so as to obtain the business data corresponding to the target application based on the address information.
[0141] In an embodiment of the present application, the key-value information corresponding to the business data may be one or more. When the business data corresponds to multiple key-value information, the business data as a whole is divided into multiple parts, each part corresponding to a key-value information. In the case where the business data corresponds to multiple key-value information, the address information of each part in the persistent storage unit can be queried in batches. For example, a corresponding loop query statement can be used to implement a batch query, the key-value information is sorted into a list, and then the address information corresponding to each part is queried one by one through a loop query statement according to the arrangement order of the key-value information in the list, thereby obtaining the overall business data.
[0142] It should be noted that in the embodiment of the present application, when storing business data in a temporary storage unit, an asynchronous call method can be used. In this way, the concurrency and response efficiency of data processing can be improved, and blocking can be avoided. In particular, the blocking problem caused by querying and obtaining business data on the persistent storage unit can be avoided, and the probability of application crash or abnormal termination can be reduced, which is conducive to improving the running stability of the application.
[0143] Specifically, in a possible implementation, after the step of receiving the second data in response to the data write request and writing the second data into the temporary storage unit by synchronous calling, the method provided in the embodiment of the present application further includes:
[0144] copying the second data;
[0145] The copied second data is written into the persistent storage unit by means of an asynchronous call.
[0146] As described above, during the running phase of the target application, synchronous call processing of business data can be implemented based on the temporary storage unit. For data read requests, it has no effect on the business data stored in the temporary storage unit, so the response to such requests can be completed based on the temporary storage unit itself. As for data write requests, since it actually changes the business data stored in the temporary storage unit, it has an impact on the business data of the target application. Therefore, it is necessary to record the change to the persistent storage unit so that when the target application is started later, the request response can be implemented based on the changed business data.
[0147] In an embodiment of the present application, for a data write request generated during the operation phase of the target application, after obtaining the second data, the second data can be copied, and then the obtained second data can be written to the persistent storage unit. It should be pointed out that in the code logic of the target application, the writing of synchronous calls can be implemented based on the method provided in an embodiment of the present application. As for the writing of the second data to the persistent storage unit, an asynchronous call can be used, which can avoid the blocking problem caused to the persistent storage unit when the second data is written, and can reduce the probability of application crash or abnormal termination, which is conducive to improving the running stability of the application.
[0148] In the previous embodiments, the business data processing method of the application provided in the embodiments of the present application is introduced and illustrated by taking a conventional target application as an example. In the technical field related to the application, as the functions of the application become increasingly complex, a solution for deploying the application in a container has emerged. Generally speaking, when an application is deployed in a container, the application is split, and an application is split into multiple units according to functions or requirements, and then each unit is deployed into a container. In this way, when executing specific business functions, related business data can be collaboratively processed based on one or more containers.
[0149] For example, please refer to Figure 4 , Figure 4 A schematic diagram of a page of a video playback application provided in an embodiment of the present application is shown. The page includes a video content area 410, a bullet screen interaction area 420, and an associated mounting area 430. The video content area 410 can be used to display the video content being played; the bullet screen interaction area 420 can be used to provide interactive services associated with video playback. For example, in Figure 4 In the video, the bullet screen interaction area 420 can provide a chat room function, and the people watching the video and the host (the person responsible for playing the video) can communicate in the chat room, thereby improving the video viewing experience. The associated mounting area 430 can be used to mount some additional application functions. Figure 4 The application functions displayed in the middle associated mounting area 430 include two, which can be used to provide the functions of "bullet screen lottery" and "sign-in reward" respectively.
[0150] for Figure 4 The video playback application shown can use a containerized deployment solution. The entire content of the page is placed in different containers for display, thereby achieving a more flexible and maintainable page layout and effect. Container technology can better organize and control various elements and content in the page, and support nested display of multiple page types. For example, in some embodiments, when you click on Figure 4When you see the "Danmu Lottery" displayed in the picture, you can jump to the lottery page on the corresponding web page to participate in the lottery.
[0151] Specifically, refer to Figure 5 and Figure 6 In the embodiment of the present application, two containers can be used to deploy the display Figure 4 The page of the video playback application shown in the figure records the two containers as the first container and the second container respectively. Figure 5 , a schematic diagram of a page displaying content contained in a first container provided in an embodiment of the present application is shown in FIG. In the first container, a video content area 410 and a bullet screen interaction area 420 in a video playback application are arranged; Figure 6 A schematic diagram of a page displaying content contained in a second container provided by an embodiment of the present application is shown in , and in the second container, an associated mounting area 430 is laid out. In specific applications, the display windows of the first container and the second container can be overlapped, so that the video playback application can display the overall page layout. When executing specific business functions, when the target object wants to speak in the chat room and input bullet screen, the corresponding business processing is implemented through the first container; when the target object wants to click on the "bullet screen lottery" displayed in the associated mounting area 430, the corresponding business processing is implemented through the second container.
[0152] It should be noted that the above embodiments are only used to exemplify the principles and functions of containerized deployment of applications, and are not meant to limit their specific implementation. They can be flexibly set as needed, and this application will not elaborate on this.
[0153] In the above containerized deployment of application programs, the business data involved in the application program is associated with multiple containers, and these containers all need to use the business data to perform business processing tasks. Therefore, in the embodiment of the present application, a business data processing method corresponding to such containerized deployed application program is provided, which is introduced and explained below.
[0154] Specifically, in a possible implementation, the target application is run based on at least two containers; storing the business data in a temporary storage unit includes:
[0155] Determine a temporary storage unit pre-allocated to each container; wherein each container corresponds to a temporary storage unit;
[0156] Store business data in the temporary storage unit corresponding to each container.
[0157] In the embodiment of the present application, as described above, for the containerized deployed application, the business data involved is associated with multiple containers, and these containers all need to use the business data to perform business processing tasks. Therefore, in the embodiment of the present application, if the target application is a containerized deployment type, that is, it is based on at least two containers when running, in order to facilitate the normal operation of each container, a corresponding temporary storage unit can be allocated to each container, and then the business data can be copied into multiple copies and stored in the temporary storage units corresponding to each container. In this way, each container can use the business data stored in the corresponding temporary storage unit to implement the corresponding business logic during operation.
[0158] It should be noted that in the embodiment of the present application, the storage space size of the temporary storage unit allocated to each container can be the same. The present application does not limit the specific storage space size, the number of containers and temporary storage units, and can be flexibly set as needed.
[0159] Specifically, in a possible implementation, the at least two containers include a first container and a second container, the temporary storage unit includes a first temporary storage unit and a second temporary storage unit, the first container corresponds to the first temporary storage unit, and the second container corresponds to the second temporary storage unit; the method provided in the embodiment of the present application also includes:
[0160] detecting an operating status of the first container;
[0161] If the first container is in the foreground running state, detecting whether the business data corresponding to the target application stored in the persistent storage unit changes during the process in which the first container is in the foreground running state;
[0162] If the business data corresponding to the target application stored in the persistent storage unit changes, when the first container switches from the foreground running state to the background running state, the target data is extracted from the persistent storage unit; the target data is the business data corresponding to the target application stored in the persistent storage unit at the switching time node;
[0163] The target data is stored in the second temporary storage unit.
[0164] In the embodiment of the present application, for the target application deployed in containerization, in the working process of the target application, the container may have different running states, for example, it may include a foreground running state and a background running state. When the container is in the foreground running state, the target object can interact with the container, for example, input an operation instruction to trigger the relevant application function in the container. When the container is in the background running state, it will be temporarily in a dormant state, and the target object can wake up the container through relevant operation instructions to make it re-enter the foreground running state.
[0165] It should be noted that when a container enters the background running state, other containers are in the foreground running state. When the target object interacts with other containers, the business data may change, resulting in changes in the business data corresponding to the target application stored in the persistent storage unit and the business data stored in the temporary storage unit corresponding to the container in the foreground running state. However, the business data in the temporary storage unit corresponding to the container entering the background running state has not changed synchronously. If the container running state is switched, the business data corresponding to different containers may be different, and the displayed page information may be out of sync.
[0166] In order to solve the above-mentioned problems, in an embodiment of the present application, a method for implementing the business data stored in the temporary storage unit corresponding to the synchronization container is provided. Specifically, taking the deployment of the target application through the first container and the second container as an example, the temporary storage unit includes a first temporary storage unit and a second temporary storage unit, wherein the first container corresponds to the first temporary storage unit, and the second container corresponds to the second temporary storage unit. In an embodiment of the present application, the running state of the first container can be detected. If the first container is in the foreground running state, then the second container is in the background running state. Then it can be detected whether the business data has changed when the first container is in the foreground running state. Specifically, it can be achieved by detecting whether the business data corresponding to the target application stored in the persistent storage unit has changed. If it is found that the business data corresponding to the target application stored in the persistent storage unit has changed, it means that the business data stored in the second temporary storage unit needs to be updated at this time to maintain the consistency of the business data corresponding to the multiple containers.
[0167] In the embodiment of the present application, when updating the business data to the second temporary storage unit, the target data can be extracted once when the first container switches from the foreground running state to the background running state. The target data here refers to the business data corresponding to the target application stored in the persistent storage unit when the first container switches the time node. In other words, when the first container switches the running state, the business data stored in the persistent storage unit at the switching time node is recorded, so that the changes in the business data that occurred during the first container being in the foreground running state can be obtained. Then, the target data can be stored in the second temporary storage unit to complete the update of the business data.
[0168] It is understandable that in the embodiment of the present application, when the first container is in the foreground running state, the business data stored in the first temporary storage unit and the persistent storage unit will change based on the interaction of the target object. When the first container switches to the background running state, the synchronization of business data in the temporary storage units corresponding to different containers can be achieved by recording the target data and storing the target data in the second temporary storage unit. In this way, the business data corresponding to each container can be consistent, thereby improving the situation where the displayed page information is out of sync.
[0169] It should be noted that in the embodiment of the present application, the containers involved in the target application are not limited to the first container and the second container. When there are more than two containers, when each container switches from the foreground running state to the background running state, the changes in the business data that occurred during the container's foreground running state can be synchronized to the temporary storage units corresponding to other containers. The present application does not impose any restrictions on this.
[0170] Specifically, in a possible implementation manner, the method provided in the embodiment of the present application further includes:
[0171] detecting an operating status of the second container;
[0172] If the second container is in the background running state, detecting whether the business data corresponding to the target application stored in the persistent storage unit changes during the process in which the second container is in the background running state;
[0173] If the business data corresponding to the target application stored in the persistent storage unit changes, when the second container switches from the background running state to the foreground running state, the target data is extracted from the persistent storage unit; the target data is the business data corresponding to the target application stored in the persistent storage unit at the switching time node;
[0174] The target data is stored in the second temporary storage unit.
[0175] In an embodiment of the present application, another implementation method for synchronizing the business data stored in the temporary storage unit corresponding to the container is also provided. Specifically, still taking the deployment of the target application through the first container and the second container as an example, in an embodiment of the present application, the running status of the second container can be detected. If the second container is in the background running state, relatively, the first container is in the foreground running state at this time. Then it can be detected whether the business data has changed when the second container is in the background running state this time. Specifically, it can be achieved by detecting whether the business data corresponding to the target application stored in the persistent storage unit has changed. If it is found that the business data corresponding to the target application stored in the persistent storage unit has changed, it means that the business data stored in the second temporary storage unit needs to be updated at this time to maintain the consistency of the business data corresponding to multiple containers.
[0176] When updating the business data to the second temporary storage unit, in order to improve the update efficiency and reduce the number of updates, in the embodiment of the present application, the target data can be extracted once when the second container switches from the background running state to the foreground running state. The target data here refers to the business data corresponding to the target application stored in the persistent storage unit when the second container switches the time node. In other words, when the second container switches the running state, the business data stored in the persistent storage unit at the switching time node is recorded, so that the changes in the business data that occurred during the second container being in the background running state can be obtained at one time. Then, the target data can be stored in the second temporary storage unit to complete the update of the business data.
[0177] It is understandable that, compared with the implementation in the aforementioned embodiment, in the embodiment of the present application, the running state switching of other containers is not considered. For the container that needs to complete the business data update, only the content of the business data when the container switches the running state is concerned, which can be updated at one time, which can effectively reduce the number of updates and is more suitable for the situation where there are more than two containers in the target application. In addition, the embodiment of the present application can also make the business data corresponding to each container consistent, thereby improving the situation where the displayed page information is out of sync.
[0178] Specifically, in a possible implementation, after the step of extracting the target data from the persistent storage unit, the method provided in the embodiment of the present application further includes:
[0179] Serialize the target data to obtain the target string;
[0180] Storing the target data in the second temporary storage unit includes:
[0181] Deserialize the target string to obtain the target data;
[0182] The data currently stored in the second temporary storage unit is cleared, and the target data is written into the cleared second temporary storage unit.
[0183] In an embodiment of the present application, when the target data is extracted and stored in a temporary storage unit (taking the second temporary storage unit as an example) where the business data needs to be updated, the data can be serialized and deserialized in the process. Specifically, after the target data is extracted, the target data can be serialized to obtain a string, which is recorded as the target string in an embodiment of the present application. Here, the target data can be serialized using a suitable serialization method, such as JSON, XML, Protobuf and other programming languages, and the present application does not limit this.
[0184] When storing the target data in the second temporary storage unit, the target string can be deserialized to restore the target data, and then the data currently stored in the second temporary storage unit is cleared, and the obtained target input is written into the second temporary storage unit.
[0185] In the embodiments of the present application, by serializing and deserializing the target data, the data can be converted into a transmittable format, which facilitates the transmission of data on different platform terminals or systems using different programming languages, and has the advantages of cross-platform, cross-programming language, and version compatibility.
[0186] Specifically, in a possible implementation manner, the method provided in the embodiment of the present application further includes:
[0187] Save the target string in a predetermined variable;
[0188] Deserialize the target string based on the variable, and after the deserialization of the target string is completed, make the variable empty.
[0189] In the embodiment of the present application, a variable can be used to save the obtained target string. For example, after obtaining the target string, the target string can be assigned to a predetermined variable "target_string". Then, when the target string is deserialized, the target string can be directly extracted through the variable "target_string" and converted into target data. After the processing is completed, the variable "target_string" can be set to Null, that is, the variable is left empty to ensure that it no longer holds a reference relationship to the target string, so that the call processing of the target string can be easily implemented.
[0190] Specifically, in a possible implementation manner, the method provided in the embodiment of the present application further includes:
[0191] When the target application is in the destruction phase, the data stored in the current temporary storage unit is cleared.
[0192] In an embodiment of the present application, when it is determined that the target application is in the destroyed stage (Destroyed), it means that the target application has completely exited operation. As described above, all state information of the application in the destroyed stage will be cleared, including temporary files, memory cache, etc. When the application is started next time, all data needs to be reloaded and initialized. Therefore, in an embodiment of the present application, the data stored in the temporary storage unit corresponding to the target application can be cleared. If the target application is deployed based on multiple containers, the data stored in the temporary storage units corresponding to each container can be cleared.
[0193] Below, in conjunction with the specific application implementation process, the business data processing method of the application provided in this application is introduced and explained in detail.
[0194] In an embodiment of the present application, a business data processing method of an application is provided, which can be applied to a financial management application, which is a software application designed to help individuals or families manage and plan finances. It provides a series of functions and tools to help target objects analyze financial information such as income, expenditure, and investment in order to make wise financial decisions. Exemplarily, the financial management application currently under development is a multi-terminal application that needs to be deployed to the H5 web page, the applet, and the mobile terminal (including iOS and Android), wherein the H5 web page and the applet use a synchronous application programming interface, which only supports synchronous calls to implement business data processing; and the mobile terminal side uses the hippy framework for development and deployment, and the cross-terminal application framework implements business data processing based on the asynchronous application programming interface. In order to synchronize multi-terminal codes, it is necessary to implement compatibility processing of the calling method on the mobile terminal side.
[0195] Specifically, in an embodiment of the present application, when implementing compatibility processing of the calling method on the mobile terminal side, first, for the financial management application (i.e., the target application) with a traditional deployment method, the persistent data (i.e., business data) corresponding to the application that has been stored locally on the mobile terminal can be loaded from the disk (i.e., the persistent storage unit) to the memory (i.e., the temporary storage unit) during the startup phase of the application; while the application is in the running phase, for requests that need to obtain data, the acquisition is implemented based on the memory (i.e., the temporary storage unit); for requests that need to write data, a double write operation is performed.
[0196] Reference Figure 7 , Figure 7A schematic diagram of a method provided in an embodiment of the present application for loading local persistent data (i.e., business data) of a mobile terminal from a disk (i.e., a persistent storage unit) into a memory (i.e., a temporary storage unit) is shown. In an embodiment of the present application, when the hippy framework is initialized by starting a financial management application (i.e., a target application), the locally stored persistent data (i.e., business data) can be loaded into the memory (i.e., a temporary storage unit), and the component can be rendered after the loading is completed. Specifically, in an embodiment of the present application, when the persistent data (i.e., business data) is loaded into the memory (i.e., a temporary storage unit), the key (i.e., key value information) corresponding to each persistent data (i.e., business data) can be obtained first, and then the persistent data (i.e., business data) can be batch queried, obtained from the disk (i.e., a persistent storage unit), and stored in the memory (i.e., a temporary storage unit) by means of an asynchronous call.
[0197] Reference Figure 8 , Figure 8 A schematic diagram of a dual write operation and a read operation on data provided in an embodiment of the present application is shown. In an embodiment of the present application, when writing data, for the data to be written (i.e., the second data), the data can first be written to the memory (i.e., the temporary storage unit) by a synchronous call, and then the data can be written to the disk (i.e., the persistent storage unit) by an asynchronous call. The former is to achieve synchronous writing of data, and the latter is to persist the data. When reading data, it can be read directly from the memory (i.e., the temporary storage unit) by a synchronous call.
[0198] In an embodiment of the present application, for a financial management application (i.e., a target application) deployed in a containerized manner, a data synchronization strategy between multiple containers is also provided. Specifically, by registering an event on the mobile terminal, when the persistent data (i.e., business data) changes, the event will be triggered, thereby achieving the effect of synchronizing the memory (i.e., temporary storage unit) data.
[0199] For details, please refer to Fig. 9 , Fig. 9 A schematic diagram of data synchronization between multiple containers provided in an embodiment of the present application is shown. In an embodiment of the present application, a native event can be provided locally by the mobile terminal, and when it is found that the persistent data (i.e., business data) corresponding to the financial management application (i.e., the target application) stored in the disk (i.e., the persistent storage unit) changes, the event will be triggered; when the event is triggered, the front end can obtain the persistent data (i.e., business data), and then serialize the persistent data (i.e., business data) to obtain a data string (i.e., the target string), and save it in a predetermined variable. When the operating state of the container switches, for example, Fig. 9The financial management application (i.e., the target application) is deployed based on two containers, namely hippy container 1 (i.e., the first container) and webview container 2 (i.e., the second container). Each container corresponds to a memory cache area (i.e., a temporary storage unit), hippy container 1 (i.e., the first container) corresponds to cache area 1 (i.e., the first temporary storage unit), and webview container 2 (i.e., the second container) corresponds to cache area 2 (i.e., the second temporary storage unit). When hippy container 1 (i.e., the first container) is in the background running state, the data returned by the event is received and stored in a predetermined variable; when hippy container 1 (i.e., the first container) switches from the background running state to the foreground running state (onshow), it will stop receiving the data returned by the event, deserialize the data string (i.e., the target string) stored in the current variable, obtain persistent data (i.e., business data), synchronize to cache area 1 (i.e., the first temporary storage unit), and set the variable to zero. Similarly, for webview container 2 (i.e., the second container), the same method is used to synchronize the persistent data (i.e., business data) in cache area 2 (i.e., the second temporary storage unit), which will not be described in detail in this application.
[0200] Reference Fig.10 In an embodiment of the present application, a business data processing device for an application is also provided, including:
[0201] The detection unit 1010 is used to detect the stage of the target application; wherein the target application is developed using a cross-end application framework, and the cross-end application framework implements business data processing based on an asynchronous application programming interface;
[0202] The transfer unit 1020 is used to query and obtain the business data corresponding to the target application from the persistent storage unit when the target application is in the startup phase, and store the business data in the temporary storage unit;
[0203] The read-write unit 1030 is used to respond to a data read request and read the first data from the temporary storage unit by means of a synchronous call when the target application is in the running stage; or, respond to a data write request, receive the second data and write the second data to the temporary storage unit by means of a synchronous call; wherein the business data includes the first data.
[0204] Optionally, the device further includes a trigger unit, and the trigger unit is specifically used to:
[0205] Detecting the touch screen operation of the target object on the terminal device, and triggering the target application to enter the startup phase according to the touch screen operation;
[0206] Alternatively, voice data of the target object is obtained, voice recognition is performed on the voice data, and the target application is triggered to enter the startup phase according to the result of the voice recognition.
[0207] Optionally, the transfer unit is specifically used for:
[0208] When the target application is in the startup phase, the configuration file of the target application is parsed to determine the persistent storage path of the business data corresponding to the target application;
[0209] According to the persistent storage path, query and obtain the business data corresponding to the target application from the persistent storage unit.
[0210] Optionally, the transfer unit is specifically used for:
[0211] When the target application is in the startup phase, key value information of the business data corresponding to the target application is obtained;
[0212] According to the key value information, query the address information of the business data in the persistent storage unit;
[0213] The business data corresponding to the target application is obtained according to the address information, and the business data is stored in a temporary storage unit through an asynchronous call.
[0214] Optionally, the device further includes a second writing unit, and the second writing unit is specifically configured to:
[0215] copying the second data;
[0216] The copied second data is written into the persistent storage unit by means of an asynchronous call.
[0217] Optionally, the target application runs based on at least two containers; the transfer unit is specifically used for:
[0218] Determine a temporary storage unit pre-allocated to each container; wherein each container corresponds to a temporary storage unit;
[0219] Store business data in the temporary storage unit corresponding to each container.
[0220] Optionally, the at least two containers include a first container and a second container, the temporary storage unit includes a first temporary storage unit and a second temporary storage unit, the first container corresponds to the first temporary storage unit, and the second container corresponds to the second temporary storage unit; the device further includes a storage processing unit, and the storage processing unit is specifically used to:
[0221] detecting an operating status of the first container;
[0222] If the first container is in the foreground running state, detecting whether the business data corresponding to the target application stored in the persistent storage unit changes during the process in which the first container is in the foreground running state;
[0223] If the business data corresponding to the target application stored in the persistent storage unit changes, when the first container switches from the foreground running state to the background running state, the target data is extracted from the persistent storage unit; the target data is the business data corresponding to the target application stored in the persistent storage unit at the switching time node;
[0224] The target data is stored in the second temporary storage unit.
[0225] Optionally, the at least two containers include a first container and a second container, the temporary storage unit includes a first temporary storage unit and a second temporary storage unit, the first container corresponds to the first temporary storage unit, and the second container corresponds to the second temporary storage unit; the device further includes a storage processing unit, and the storage processing unit is specifically used to:
[0226] detecting an operating status of the second container;
[0227] If the second container is in the background running state, detecting whether the business data corresponding to the target application stored in the persistent storage unit changes during the process in which the second container is in the background running state;
[0228] If the business data corresponding to the target application stored in the persistent storage unit changes, when the second container switches from the background running state to the foreground running state, the target data is extracted from the persistent storage unit; the target data is the business data corresponding to the target application stored in the persistent storage unit at the switching time node;
[0229] The target data is stored in the second temporary storage unit.
[0230] Optionally, the device further includes a sequence processing unit, and the sequence processing unit is specifically used to:
[0231] Serialize the target data to obtain the target string;
[0232] Deserialize the target string to obtain the target data;
[0233] The data currently stored in the second temporary storage unit is cleared, and the target data is written into the cleared second temporary storage unit.
[0234] Optionally, the device further includes a variable processing unit, and the variable processing unit is specifically used for:
[0235] Save the target string in a predetermined variable;
[0236] Deserialize the target string based on the variable, and after the deserialization of the target string is completed, make the variable empty.
[0237] Optionally, the device further comprises a clearing unit, and the clearing unit is specifically used for:
[0238] When the target application is in the destruction phase, the data stored in the current temporary storage unit is cleared.
[0239] It is understandable that if Figure 2 The contents of the application program's business data processing method embodiment shown in the figure are applicable to the application program's business data processing device embodiment. The functions specifically implemented by the application program's business data processing device embodiment are similar to those in the example above. Figure 2 The business data processing method embodiment of the application shown in the figure is the same as that of the embodiment of the application shown in the figure, and the beneficial effects achieved are the same as those of the embodiment of the application shown in the figure. Figure 2 The beneficial effects achieved by the business data processing method embodiment of the application shown are also the same.
[0240] The present application also discloses an electronic device, including:
[0241] at least one processor;
[0242] at least one memory for storing at least one program;
[0243] When at least one program is executed by at least one processor, the at least one processor implements Figure 2 An embodiment of a business data processing method of an application is shown.
[0244] It is understandable that if Figure 2 The contents of the application program service data processing method embodiment shown in the figure are applicable to the electronic device embodiment, and the functions specifically implemented by the electronic device embodiment are similar to those in the embodiment shown in the figure. Figure 2 The business data processing method embodiment of the application shown in the figure is the same as that of the embodiment of the application shown in the figure, and the beneficial effects achieved are the same as those of the embodiment of the application shown in the figure. Figure 2 The beneficial effects achieved by the business data processing method embodiment of the application shown are also the same.
[0245] The electronic device of the embodiment of the present application may be a terminal device, a computer device or a server device.
[0246] For example, refer to Fig.11 , Fig.11 Schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Taking the electronic device as a terminal device as an example, Fig.11In the embodiment, the terminal device 1100 may include an RF (Radio Frequency) circuit 1110, a memory 1120 including one or more computer-readable storage media, an input unit 1130, a display unit 1140, a sensor 1150, an audio circuit 1160, a short-range wireless transmission module 1170, a processor 1180 including one or more processing cores, and a power supply 1190. Those skilled in the art will appreciate that Fig.11 The device structure shown in the figure does not constitute a limitation on the terminal device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0247] The RF circuit 1110 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is handed over to one or more processors 1180 for processing; in addition, the data related to the uplink is sent to the base station. Generally, the RF circuit 1110 includes but is not limited to an antenna, at least one amplifier, a tuner, one or more oscillators, a subject identity module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, etc. In addition, the RF circuit 1110 can also communicate with the network and other devices through wireless communication. Wireless communication can use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), etc.
[0248] The memory 1120 can be used to store software programs and modules (or units). The processor 1180 executes various functional applications and data processing by running the software programs and modules (or units) stored in the memory 1120. The memory 1120 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function), etc.; the data storage area may store data created according to the use of the terminal device 1100 (such as audio data, a phone book), etc. In addition, the memory 1120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 1120 may also include a memory controller to provide the processor 1180 and the input unit 1130 with access to the memory 1120. Although Fig.11 The RF circuit 1110 is shown, but it is understandable that it is not a necessary component of the terminal device 1100 and can be omitted as needed without changing the essence of the invention.
[0249] The input unit 1130 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to object setting and function control. Specifically, the input unit 1130 may include a touch-sensitive surface 1131 and other input devices 1132. The touch-sensitive surface 1131, also known as a touch display screen or touch pad, can collect touch operations of an object on or near it (such as operations of an object using a finger, stylus or any other suitable object or accessory on or near the touch-sensitive surface 1131), and drive the corresponding connection device according to a pre-set program. Optionally, the touch-sensitive surface 1131 may include a touch detection device and a touch controller. Among them, the touch detection device detects the touch orientation of the object, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 1180, and can receive instructions sent by the processor 1180 and execute them. In addition, the touch-sensitive surface 1131 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 1131, the input unit 1130 may further include other input devices 1132. Specifically, the other input devices 1132 may include, but are not limited to, one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.
[0250] The display unit 1140 can be used to display information input by an object or information provided to an object and to control various graphic object interfaces of the terminal device 1100. These graphic object interfaces can be composed of graphics, texts, icons, videos and any combination thereof. The display unit 1140 may include a display panel 1141. Optionally, the display panel 1141 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch-sensitive surface 1131 may be covered on the display panel 1141. When the touch-sensitive surface 1131 detects a touch operation on or near it, it is transmitted to the processor 1180 to determine the type of touch event. Subsequently, the processor 1180 provides corresponding visual output on the display panel 1141 according to the type of touch event. Although in Fig.11 In the embodiment, the touch-sensitive surface 1131 and the display panel 1141 are implemented as two independent components to implement input and output functions, but in some embodiments, the touch-sensitive surface 1131 and the display panel 1141 can be integrated to implement input and output functions.
[0251] The terminal device 1100 may also include at least one sensor 1150, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1141 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 1141 or the backlight when the terminal device 1100 is moved to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that can also be configured in the terminal device 1100, they will not be repeated here.
[0252] The audio circuit 1160, the speaker 1161, and the microphone 1162 can provide an audio interface between the object and the terminal device 1100. The audio circuit 1160 can transmit the electrical signal converted from the received audio data to the speaker 1161, which is converted into a sound signal for output; on the other hand, the microphone 1162 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1160 and converted into audio data, and then the audio data is processed by the output processor 1180 and sent to another electronic device through the RF circuit 1110, or the audio data is output to the memory 1120 for further processing. The audio circuit 1160 may also include an earplug jack to provide communication between an external headset and the terminal device 1100.
[0253] The short-range wireless transmission module 1170 may be a WIFI (wireless fidelity) module, a Bluetooth module, an infrared module, etc. The terminal device 1100 may transmit information with wireless transmission modules provided on other devices through the short-range wireless transmission module 1170 .
[0254] The processor 1180 is the control center of the terminal device 1100. It uses various interfaces and lines to connect various parts of the entire device. By running or executing software programs or modules stored in the memory 1120, and calling data stored in the memory 1120, it executes various functions of the terminal device 1100 and processes data, thereby controlling the device as a whole. Optionally, the processor 1180 may include one or more processing cores; optionally, the processor 1180 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, object interface and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1180.
[0255] The terminal device 1100 also includes a power supply 1190 (such as a battery) for supplying power to various components. Optionally, the power supply 1190 can be logically connected to the processor 1180 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 1190 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0256] Although not shown, the terminal device 1100 may also include a camera, a Bluetooth module, etc., which will not be described in detail here.
[0257] The present application also discloses a computer-readable storage medium in which a program executable by a processor is stored. When the program executable by the processor is executed by the processor, it is used to implement the following Figure 2 An embodiment of a business data processing method of an application is shown.
[0258] Understandably, Figure 2 The contents of the business data processing method embodiment of the application shown in the figure are applicable to the embodiment of the computer-readable storage medium. The functions specifically implemented by the embodiment of the computer-readable storage medium are the same as those in the embodiment of the computer-readable storage medium. Figure 2 The business data processing method embodiment of the application shown is the same as that of the embodiment of the application shown in FIG. Figure 2 The beneficial effects achieved by the business data processing method embodiment of the application shown are also the same.
[0259] The embodiment of the present application further discloses a computer program product or a computer program, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in the above-mentioned computer-readable storage medium; Fig.11 The processor of the electronic device shown can read the computer instruction from the above-mentioned computer readable storage medium, and the processor executes the computer instruction so that the computer device executes Figure 2 An embodiment of a business data processing method of an application is shown.
[0260] Understandably, Figure 2 The contents of the business data processing method embodiment of the application shown in the figure are applicable to the present computer program product or computer program embodiment, and the functions specifically implemented by the present computer program product or computer program embodiment are the same as those in the embodiment of the present invention. Figure 2 The business data processing method embodiment of the application shown is the same as that of the embodiment of the application shown in FIG. Figure 2 The beneficial effects achieved by the business data processing method embodiment of the application shown are also the same.
[0261] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the application is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part described as a larger operation is performed independently.
[0262] In addition, although the present application is described in the context of functional modules, it should be understood that, unless otherwise specified, one or more of the functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present application. More specifically, in view of the properties, functions, and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional techniques of the engineer. Therefore, those skilled in the art can implement the present application set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present application, which is determined by the full scope of the attached claims and their equivalents.
[0263] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.
[0264] The logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be embodied in any computer-readable storage medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, apparatus, or device and execute instructions), or in conjunction with such instruction execution system, apparatus, or device. For purposes of this specification, a "computer-readable storage medium" may be any device that can contain, store, communicate, propagate, or transmit a program for use by an instruction execution system, apparatus, or device, or in conjunction with such instruction execution system, apparatus, or device.
[0265] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0266] In the above description of this specification, the description with reference to the terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0267] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.
[0268] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the embodiments. Technical personnel familiar with the field can make various equivalent modifications or substitutions without violating the spirit of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.
Claims
1. A method for processing business data of an application, characterized in that: The method comprises: Detecting the stage of a target application; wherein the target application is developed using a cross-end application framework, and the cross-end application framework implements business data processing based on an asynchronous application programming interface; When the target application is in the startup phase, querying and acquiring the business data corresponding to the target application from the persistent storage unit, and storing the business data in the temporary storage unit; When the target application is in the running stage, in response to a data read request, first data is read from the temporary storage unit by means of a synchronous call; or, in response to a data write request, second data is received and the second data is written to the temporary storage unit by means of a synchronous call; wherein the business data includes the first data.
2. The method for processing business data of an application according to claim 1, characterized in that: The launch phase of the target application is triggered by the following steps: Detecting a touch screen operation of a target object on a terminal device, and triggering the target application to enter a startup phase according to the touch screen operation; Alternatively, voice data of the target object is acquired, voice recognition is performed on the voice data, and the target application is triggered to enter a startup phase according to a result of the voice recognition.
3. The method for processing business data of an application according to claim 1, characterized in that: When the target application is in the startup phase, querying and acquiring the business data corresponding to the target application from the persistent storage unit includes: When the target application is in the startup phase, parsing the configuration file of the target application to determine the persistent storage path of the business data corresponding to the target application; According to the persistent storage path, the business data corresponding to the target application is queried and acquired from the persistent storage unit.
4. The method for processing business data of an application according to claim 1, characterized in that: When the target application is in the startup phase, querying and acquiring the business data corresponding to the target application from the persistent storage unit, and storing the business data in the temporary storage unit, comprises: When the target application is in the startup phase, obtaining key value information of business data corresponding to the target application; According to the key value information, query the address information of the business data in the persistent storage unit; The business data corresponding to the target application is acquired according to the address information, and the business data is stored in the temporary storage unit by asynchronous calling.
5. The method for processing business data of an application according to any one of claims 1 to 4, characterized in that: After the step of receiving the second data in response to the data write request and writing the second data into the temporary storage unit by synchronous calling, the method further includes: copying the second data; The copied second data is written into the persistent storage unit by means of an asynchronous call.
6. The method for processing business data of an application according to claim 1, characterized in that: The target application is run based on at least two containers; and storing the business data in a temporary storage unit includes: Determine a temporary storage unit pre-allocated to each of the containers; wherein each of the containers corresponds to one temporary storage unit; The business data is stored in a temporary storage unit corresponding to each container.
7. The method for processing business data of an application according to claim 6, characterized in that: The at least two containers include a first container and a second container, the temporary storage unit includes a first temporary storage unit and a second temporary storage unit, the first container corresponds to the first temporary storage unit, and the second container corresponds to the second temporary storage unit; the method further includes: detecting the operating status of the first container; If the first container is in the foreground running state, detecting whether the business data corresponding to the target application stored in the persistent storage unit changes during the process in which the first container is in the foreground running state; If the business data corresponding to the target application stored in the persistent storage unit changes, when the first container switches from the foreground running state to the background running state, the target data is extracted from the persistent storage unit; the target data is the business data corresponding to the target application stored in the persistent storage unit at the switching time node; The target data is stored in the second temporary storage unit.
8. The method for processing business data of an application according to claim 6, characterized in that: The at least two containers include a first container and a second container, the temporary storage unit includes a first temporary storage unit and a second temporary storage unit, the first container corresponds to the first temporary storage unit, and the second container corresponds to the second temporary storage unit; the method further includes: detecting an operating status of the second container; If the second container is in the background running state, detecting whether the business data corresponding to the target application stored in the persistent storage unit changes during the process in which the second container is in the background running state; If the business data corresponding to the target application stored in the persistent storage unit changes, when the second container switches from the background running state to the foreground running state, the target data is extracted from the persistent storage unit; the target data is the business data corresponding to the target application stored in the persistent storage unit at the switching time node; The target data is stored in the second temporary storage unit.
9. The method for processing business data of an application according to claim 7 or 8, characterized in that: After the step of extracting the target data from the persistent storage unit, the method further comprises: Serializing the target data to obtain a target character string; The storing the target data into the second temporary storage unit comprises: Deserialize the target string to obtain the target data; The data currently stored in the second temporary storage unit is cleared, and the target data is written into the cleared second temporary storage unit.
10. The method for processing business data of an application according to claim 9, characterized in that: The method further comprises: Storing the target character string in a predetermined variable; The target string is deserialized based on the variable, and after the deserialization of the target string is completed, the variable is left empty.
11. The method for processing business data of an application according to claim 1, characterized in that: The method further comprises: When the target application is in the destruction phase, the data currently stored in the temporary storage unit is cleared.
12. A business data processing device for an application, characterized in that: The device comprises: A detection unit, used to detect the stage of a target application; wherein the target application is developed using a cross-end application framework, and the cross-end application framework implements business data processing based on an asynchronous application programming interface; A transfer unit, used for querying and acquiring the business data corresponding to the target application from the persistent storage unit when the target application is in the startup phase, and storing the business data in the temporary storage unit; A read-write unit is used to respond to a data read request and read first data from the temporary storage unit by means of a synchronous call when the target application is in the running stage; or, respond to a data write request, receive second data and write the second data to the temporary storage unit by means of a synchronous call; wherein the business data includes the first data.
13. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the business data processing method of the application program described in any one of claims 1 to 11 is implemented.
14. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the business data processing method of the application program described in any one of claims 1 to 11 is implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the business data processing method of the application program described in any one of claims 1 to 11 is implemented.
