Method, device and computer storage medium for synchronizing data status between applications
By establishing a mapping relationship between anonymous shared memory and applications between Android applications and sending notifications of data state change, the problem of inefficient cross-process communication between Android applications is solved, and flexible and efficient data state synchronization is achieved.
Patent Information
- Application Number
- CN201910414603.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-05-17
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2039-05-17
AI Technical Summary
Cross-process communication between Android applications is not flexible and inefficient enough, resulting in difficulty in synchronizing data states.
By establishing a mapping relationship between anonymous shared memory and applications, sending notifications of data state change, realizing data state synchronization between applications.
It realizes flexible synchronization of data states between applications and improves efficiency.
Smart Images

Figure CN111949415B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and more specifically, to a method and device for synchronizing data states between applications and a computer storage medium. Background Art
[0002] As Android application development becomes more mature, there are more and more scenarios where multiple applications need to communicate and interact continuously. For example, applications need to synchronize a certain state at the same time, but because there is a memory isolation mechanism between Android applications, it is very troublesome to synchronize a certain state at the same time.
[0003] Usually, cross-process communication between Android applications is encapsulated by the system, and only system service applications can share data status with non-system service applications. Non-system service applications generally communicate by using contentprovider or inter-application broadcast to share data status. However, this communication method is not flexible enough and inefficient.
[0004] Therefore, the inventors believe that it is necessary to improve at least one of the problems existing in the above-mentioned prior art. Summary of the invention
[0005] An object of an embodiment of the present invention is to provide a new technical solution for synchronizing data states between applications.
[0006] According to a first aspect of an embodiment of the present invention, a method for synchronizing data status between applications is provided, the method comprising:
[0007] Establishing a mapping relationship between the anonymous shared memory and the first application according to a calling instruction from the first application;
[0008] According to the change of the current data state of the first application, sending a first application data state change notification to a second application that has established a mapping relationship with the anonymous shared memory, so that the second application knows the data state of the first application;
[0009] Wherein, data status synchronization can be achieved between applications that establish mapping relationships with the anonymous shared memory.
[0010] Optionally, after the step of establishing a mapping relationship between the anonymous shared memory and the first application according to the calling instruction from the first application, the method further includes:
[0011] Determine whether the anonymous shared memory has completed the first initialization operation;
[0012] If not completed, the application data is loaded from the file persistent storage into the anonymous shared memory.
[0013] Optionally, the step of determining whether the anonymous shared memory has completed the first initialization operation includes:
[0014] It is determined whether the anonymous shared memory has completed the first initialization operation according to a preset status bit or a preset lock identifier.
[0015] Optionally, the method further comprises:
[0016] According to the exit instruction of the first application, the current data state in the anonymous shared memory is sent to the file persistent storage for storage.
[0017] Optionally, the method further comprises:
[0018] Maintaining an application registration list; the application registration list is used to record the application that currently establishes a mapping relationship with the anonymous shared memory.
[0019] Optionally, the method further comprises:
[0020] When the maintained application registration list is empty, the preset state bit or preset lock flag corresponding to the anonymous shared memory is reset.
[0021] Optionally, after the step of establishing a mapping relationship between the anonymous shared memory and the first application according to the calling instruction from the first application, the method further includes:
[0022] A memory size in the anonymous shared memory is allocated to the first application.
[0023] According to a second aspect of an embodiment of the present invention, there is provided a device for synchronizing data status between applications, the device comprising:
[0024] An establishing module, used for establishing a mapping relationship between the anonymous shared memory and the first application according to a calling instruction from the first application;
[0025] a sending module, configured to send a first application data state change notification to a second application that has established a mapping relationship with the anonymous shared memory according to a change in a current data state of the first application, so that the second application is informed of the data state of the first application;
[0026] Wherein, data status synchronization can be achieved between applications that establish mapping relationships with the anonymous shared memory.
[0027] According to a third aspect of an embodiment of the present invention, there is provided a device for synchronizing data status between applications, the device comprising: a memory and a processor, the memory being used to store instructions; the instructions being used to control the processor to operate so as to execute a method for synchronizing data status between applications as described in any one of the first aspect of the embodiment of the present invention.
[0028] According to a fourth aspect of an embodiment of the present invention, there is provided a computer storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for synchronizing data status between applications as described in any one of the first aspect of the embodiment of the present invention is implemented.
[0029] A beneficial effect of the present invention is that the synchronization of data states between applications can be achieved, and the synchronization method is flexible and efficient.
[0030] Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.
[0032] Figure 1 is a block diagram showing a hardware configuration of a client 1000 that can be used to implement an embodiment of the present invention;
[0033] Figure 2 is a flow chart of a method for synchronizing data states between applications according to an embodiment of the present invention;
[0034] Figure 3 A schematic diagram of an example according to an embodiment of the present invention;
[0035] Figure 4 is a schematic diagram of the structure of an apparatus 4000 for synchronizing data states between applications according to the present invention;
[0036] Figure 5 4 is a schematic diagram of the hardware structure of an apparatus 5000 for synchronizing data status between applications according to another embodiment. DETAILED DESCRIPTION
[0037] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless otherwise specifically stated.
[0038] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
[0039] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.
[0040] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0041] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0042] Hereinafter, various embodiments and examples according to embodiments of the present invention are described with reference to the accompanying drawings.
[0043] <Hardware Configuration>
[0044] Figure 1 is a block diagram showing a hardware configuration of a client 1000 that can be used to implement an embodiment of the present invention.
[0045] according to Figure 1 As shown, the client 1000 of this embodiment can be a portable computer, a desktop computer, a mobile phone, a tablet computer, etc.
[0046] like Figure 1 As shown, the client 1000 may include a processor 1010, a memory 1020, an interface device 1030, a communication device 1040, a display device 1050, an input device 1060, a speaker 1070, a microphone 1080, and the like. The processor 1010 may be a central processing unit CPU, a microprocessor MCU, and the like. The memory 1020 may include, for example, a ROM (read-only memory), a RAM (random access memory), a non-volatile memory such as a hard disk, and the like. The interface device 1030 may include, for example, a USB interface, an earphone interface, and the like. The communication device 1040 may, for example, be capable of wired or wireless communication. The display device 1050 may be, for example, a liquid crystal display screen, a touch display screen, and the like. The input device 1060 may include, for example, a touch screen, a keyboard, and the like. The user may input / output voice information through the speaker 1070 and the microphone 1080.
[0047] In this embodiment, the memory 1020 of the client 1000 is used to store instructions, which are used to control the processor 1010 to operate to at least execute the method for synchronizing data states between applications according to any embodiment of the present invention. Figure 1 1000, but the present invention may only involve some of the devices, for example, the client 1000 only involves the memory 1020, the processor 1010 and the display device 1050. A technician may design instructions according to the scheme disclosed in the present invention. How instructions control the processor to operate is well known in the art, so it will not be described in detail here.
[0048] <Method>
[0049] Figure 2 1 is a flow chart of a method for synchronizing data status between applications according to an embodiment of the present invention. The method can be implemented by the client 1000.
[0050] according to Figure 2 As shown, the method for synchronizing data status between applications in this embodiment may include the following steps 2100 and 2200:
[0051] Step 2100: Establish a mapping relationship between the anonymous shared memory and the first application according to a calling instruction from the first application.
[0052] In actual applications, the main body of the anonymous shared memory of the Android system is implemented in the kernel space in the form of a driver. At the same time, access interfaces are provided in the system runtime library layer and the application framework layer. Among them, the system runtime library layer provides a C / C++ calling interface, and the application framework layer provides a Java calling interface. Therefore, it can be understood here that the Android system comes with anonymous shared memory, and the first application can use anonymous shared memory through API call instructions.
[0053] Specifically, after receiving the first calling instruction, the client 1000 establishes a mapping relationship between the anonymous shared memory and the first application, and allocates a memory size in the anonymous shared memory to the first application.
[0054] The client 1000 also maintains an application registration list, which is used to record the applications currently mapping with the anonymous shared memory. For example, the applications currently mapping with the anonymous shared memory are application A, application B, and application C, and the application registration list is recorded as list = [A, B, C].
[0055] Furthermore, after step 2100 and before step 2200, the client 1000 will also determine whether the anonymous shared memory has completed the first initialization operation. If not, the application data is loaded from the file persistent storage into the anonymous shared memory. If completed, step 2200 is directly executed.
[0056] Among them, when the client 1000 determines whether the anonymous shared memory has completed the first initialization operation, it can specifically determine whether the anonymous shared memory has completed the first initialization operation according to a preset status bit or a preset lock identifier. For example, when the preset status bit is set to 0, it indicates that the anonymous shared memory has completed the first initialization operation, and when the preset status bit is set to 1, it indicates that the anonymous shared memory has not completed the first initialization operation. This embodiment does not specifically limit this.
[0057] After determining that the anonymous shared memory has not completed the first initialization operation, the client 1000 will load the application data from the file persistent storage into the anonymous shared memory. The application data refers to general storable data, any storable object. For example, the user's login status, user avatar information, data that needs to be saved after the application exits, etc. When executing the initialization operation, the client 1000 restores the application data from the file persistent storage to the anonymous shared memory.
[0058] Step 2200, based on the change of the current data state of the first application, send a first application data state change notification to the second application that has established a mapping relationship with the anonymous shared memory, so that the second application knows the data state of the first application; wherein, data state synchronization can be achieved between the applications that have established a mapping relationship with the anonymous shared memory.
[0059] In this example, the client 1000 also needs to maintain the data state in the anonymous shared memory, where the data state refers to the state of the data object in the anonymous shared memory, for example, the user's login state.
[0060] Specifically, the client 1000 may use the observer mode to observe the changes in the current data state of the first application, and if the current data state of the first application changes, a first application data state change notification is sent to the second application that has established a mapping relationship with the anonymous shared memory. Alternatively, the client 1000 may also poll the current data state of the first application, and when the current data state of the first application changes, a first application data state change notification is sent to the second application that has established a mapping relationship with the anonymous shared memory.
[0061] For example, the first application is PP Assistant and the second application is Wandoujia. When the client 1000 observes that the user uses the login page of PP Assistant to log out of the user, Wandoujia also needs to know the logout status of the user, so the client 1000 sends a notification of the logout status of PP Assistant to Wandoujia, so that Wandoujia knows the data status of PP Assistant, thereby realizing the sharing of data status between applications.
[0062] Furthermore, in this embodiment, the client 1000 may also send the current data state in the anonymous shared memory to the file persistent storage for storage according to the exit instruction of the first application.
[0063] In actual applications, after receiving the exit instruction of the first application, the client 1000 sends all current application data in the anonymous shared memory, such as user name, user avatar, login status and other current data states, to the file persistent storage for permanent storage, which makes the life cycle of the application data state longer.
[0064] Further, in this embodiment, after receiving the exit instruction of the first application, the client 1000 removes the first application from the application registration list and detects whether the application registration list is empty. When it is detected that the application registration list is empty, the client 1000 resets the preset state bit or preset lock mark corresponding to the anonymous shared memory, and waits for an application to be started again and initialize the anonymous shared memory.
[0065] For example, when the application registration list is not empty, the preset status bit is 0. When the application registration list is empty, it means that all applications have exited. At this time, the preset status corresponding to the anonymous shared memory is set to 1. After waiting for an application to be started again and initialize the anonymous shared memory, the above steps 2100 to 2200 are repeated.
[0066] According to the method for synchronizing data status between applications of the present embodiment, the client establishes a mapping relationship between an anonymous shared memory and the first application according to a calling instruction from the first application; according to a change in the current data status of the first application, a first application data status change notification is sent to a second application that has established a mapping relationship with the anonymous shared memory, so that the second application learns the data status of the first application; wherein, data status synchronization can be achieved between applications that have established a mapping relationship with the anonymous shared memory, thereby achieving synchronization of data status between applications, and the synchronization method is flexible and efficient.
[0067] <Example>
[0068] Figure 3 is a schematic diagram of an example according to an embodiment of the present invention.
[0069] like Figure 3 As shown, the method for synchronizing data states between applications in this embodiment is described by taking application A and application B as an example. Those skilled in the art can know that in actual applications, the method of this embodiment can be applied to N applications.
[0070] Step 1: Initialize anonymous shared memory after application A is started; or initialize anonymous shared memory after application B is started.
[0071] In this step, application A or application B establishes a mapping relationship with the anonymous shared memory by sending a call instruction. While establishing the mapping relationship, the processor allocates memory sizes in the anonymous shared memory to application A and application B respectively.
[0072] In actual applications, the processor will add application A and application B to the application registration list.
[0073] Step 2: Determine whether the anonymous shared memory has completed the first initialization operation. If completed, there is no need to perform the initialization operation again. If not completed, load the application data from the file persistent storage to the anonymous shared memory to synchronize the application data status.
[0074] Step 3: Application A or Application B can read / write application data from anonymous shared memory at any time during operation. The processor is responsible for maintaining the current data state and sending data state change notifications to non-active update applications when the current data state changes to synchronize the current data state.
[0075] For example, when the current data state of application A changes, the non-actively updating application is application B, and the processor sends a notification of the data state change of application A to application B to share the data state of application A with application B.
[0076] Step 4: When application A exits, an exit instruction is sent to the processor. After receiving the exit instruction of application A, the processor sends the current data state in the anonymous shared memory to the file persistent storage for permanent storage once.
[0077] In actual applications, after receiving an exit instruction from application A, the processor will also remove application A from the application registration list.
[0078] Step 5: When both application A and application B exit, the application registration list maintained in the processor is empty, then the processor resets the preset status bit or preset lock flag corresponding to the anonymous shared memory, waits for an application to start again and initialize the anonymous shared memory, and then repeats the operations from step 1 to step 5 above.
[0079] <Device>
[0080] Figure 4 4 is a schematic diagram of the structure of the device 4000 for synchronizing data status between applications according to the present invention.
[0081] according to Figure 4 As shown, the inter-application data status synchronization device 4000 may include an establishing module 4100 and a sending module 4200 .
[0082] The establishing module 4100 is used to establish a mapping relationship between the anonymous shared memory and the first application according to a calling instruction from the first application.
[0083] The sending module 4200 is used to send a first application data state change notification to a second application that has established a mapping relationship with the anonymous shared memory based on a change in the current data state of the first application, so that the second application is informed of the data state of the first application; wherein data state synchronization can be achieved between applications that have established a mapping relationship with the anonymous shared memory.
[0084] The inter-application data status synchronization device 4000 may further include a judgment module and a loading module, for judging whether the anonymous shared memory has completed the first initialization operation; if not, triggering the loading module to load application data from the file persistent storage to the anonymous shared memory.
[0085] The determination module may specifically determine whether the anonymous shared memory has completed the first initialization operation according to a preset status bit or a preset lock identifier.
[0086] Furthermore, the sending module 4200 may also be configured to send the current data state in the anonymous shared memory to the file persistent storage for storage according to an exit instruction of the first application.
[0087] The inter-application data status synchronization device 4000 may further include a maintenance module for maintaining an application registration list; the application registration list is used to record the application that currently establishes a mapping relationship with the anonymous shared memory.
[0088] The maintenance module may also be used to reset a preset state bit or a preset lock identifier corresponding to the anonymous shared memory when the maintained application registration list is empty.
[0089] Furthermore, the establishing module 4100 may also be used to allocate a memory size in the anonymous shared memory to the first application.
[0090] Figure 5 4 is a schematic diagram of the hardware structure of an apparatus 5000 for synchronizing data status between applications according to another embodiment.
[0091] according to Figure 5 As shown, the apparatus 5000 for synchronizing data states between applications in this embodiment may include a memory 5200 and a processor 5100 .
[0092] The memory 5200 is used to store instructions, which are used to control the processor 5100 to operate to execute the method for synchronizing data states between applications in any embodiment of the present invention. A technician can design instructions according to the scheme disclosed in the present invention. How instructions control the processor to operate is well known in the art, so it will not be described in detail here.
[0093] The device for synchronizing data status between applications in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here.
[0094] <Computer Storage Media>
[0095] In this embodiment, a computer storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, the method for synchronizing data states between applications as described in any embodiment of the present invention is implemented.
[0096] Those skilled in the art should understand that in the field of electronic technology, the above method can be embodied in a product through software, hardware, or a combination of software and hardware. Those skilled in the art can easily produce an information processing device based on the method of the above invention embodiment, wherein the information processing device includes a module for performing each operation in the information processing method according to the above embodiment.
[0097] It is well known to those skilled in the art that with the development of electronic information technology such as large-scale integrated circuit technology and the trend of software hardware, it has become more difficult to clearly divide the boundaries between software and hardware in computer systems. Because any operation can be implemented by software or by hardware. The execution of any instruction can be completed by hardware or by software. Whether a hardware implementation or a software implementation is adopted for a certain machine function depends on non-technical factors such as price, speed, reliability, storage capacity, and change cycle. For technicians, software implementation and hardware implementation are equivalent. Technicians can choose software or hardware to implement the above solution as needed. Therefore, no restriction is made to specific software or hardware here.
[0098] The present invention may be a device, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.
[0099] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0100] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0101] The computer program instructions for performing the operation of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present invention.
[0102] Various aspects of the present invention are described herein with reference to the flow charts and / or block diagrams of the methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each box of the flow chart and / or block diagram and the combination of each box in the flow chart and / or block diagram can be implemented by computer-readable program instructions.
[0103] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0104] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0105] The flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of an instruction, and the module, a program segment or a part of an instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that it is equivalent to implement it by hardware, implement it by software, and implement it by combining software and hardware.
[0106] Embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the marketplace, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the present invention is defined by the appended claims.
Claims
1. A method for synchronizing data status between applications, characterized in that: The method comprises: Establishing a mapping relationship between the anonymous shared memory and the first application according to a calling instruction from the first application; According to the change of the current data state of the first application, sending a first application data state change notification to a second application that has established a mapping relationship with the anonymous shared memory, so that the second application knows the data state of the first application; Wherein, the applications that establish mapping relationships with the anonymous shared memory can achieve synchronization of data status, and the data status is the status of the data objects existing in the anonymous shared memory, and the status of the data objects includes the user's logout status; The method further comprises: According to the exit instruction of the first application, the current data state in the anonymous shared memory is sent to the file persistent storage for storage.
2. The method according to claim 1, characterized in that After the step of establishing a mapping relationship between the anonymous shared memory and the first application according to the calling instruction from the first application, the method further includes: Determine whether the anonymous shared memory has completed the first initialization operation; If not completed, the application data is loaded from the file persistent storage into the anonymous shared memory.
3. The method according to claim 2, characterized in that The step of determining whether the anonymous shared memory has completed the first initialization operation includes: It is determined whether the anonymous shared memory has completed the first initialization operation according to a preset status bit or a preset lock identifier.
4. The method according to claim 1, characterized in that: The method further comprises: Maintaining an application registration list; the application registration list is used to record the application that currently establishes a mapping relationship with the anonymous shared memory.
5. The method according to claim 4, characterized in that The method further comprises: When the maintained application registration list is empty, the preset state bit or preset lock flag corresponding to the anonymous shared memory is reset.
6. The method according to claim 1, characterized in that After the step of establishing a mapping relationship between the anonymous shared memory and the first application according to the calling instruction from the first application, the method further includes: A memory size in the anonymous shared memory is allocated to the first application.
7. A device for synchronizing data status between applications, characterized in that: The device comprises: An establishing module, used for establishing a mapping relationship between the anonymous shared memory and the first application according to a calling instruction from the first application; a sending module, configured to send a first application data state change notification to a second application that has established a mapping relationship with the anonymous shared memory according to a change in a current data state of the first application, so that the second application is informed of the data state of the first application; Wherein, the applications that establish mapping relationships with the anonymous shared memory can achieve synchronization of data status, and the data status is the status of the data objects existing in the anonymous shared memory, and the status of the data objects includes the user's logout status; The sending module is further configured to send the current data state in the anonymous shared memory to the file persistent storage for storage according to the exit instruction of the first application.
8. A device for synchronizing data status between applications, characterized in that: The device comprises: a memory and a processor, the memory is used to store instructions; the instructions are used to control the processor to operate so as to execute the method for synchronizing data states between applications as described in any one of claims 1-6.
9. A computer storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed by a processor, the method for synchronizing data states between applications as described in any one of claims 1 to 6 is implemented.
