CN113779545A - Data cross-process sharing method, terminal equipment and computer readable storage medium - Google Patents

Data cross-process sharing method, terminal equipment and computer readable storage medium Download PDF

Info

Publication number
CN113779545A
CN113779545A CN202110993490.XA CN202110993490A CN113779545A CN 113779545 A CN113779545 A CN 113779545A CN 202110993490 A CN202110993490 A CN 202110993490A CN 113779545 A CN113779545 A CN 113779545A
Authority
CN
China
Prior art keywords
target
data
shared data
target shared
identifier
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110993490.XA
Other languages
Chinese (zh)
Inventor
刘锐
谢铮
熊友军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ubtech Robotics Corp
Original Assignee
Ubtech Robotics Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ubtech Robotics Corp filed Critical Ubtech Robotics Corp
Priority to CN202110993490.XA priority Critical patent/CN113779545A/en
Publication of CN113779545A publication Critical patent/CN113779545A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/44Program or device authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/604Tools and structures for managing or administering access control systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6281Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database at program execution time, where the protection is within the operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/466Transaction processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2141Access rights, e.g. capability lists, access control lists, access tables, access matrices

Abstract

The application is applicable to the technical field of data processing, and provides a data cross-process sharing method, terminal equipment and a computer readable storage medium, wherein the data cross-process sharing method comprises the following steps: receiving a data processing request from a first process, wherein the data processing request carries a first token, a first identifier of target shared data to be processed and a target data processing strategy of the target shared data; performing identity verification on the first process based on the first token; if the identity verification is successful, searching target shared data from a shared memory based on the first identifier, and processing the target shared data based on a target data processing strategy; and synchronizing the processed target shared data to each target process, wherein the target process is a process for acquiring the target shared data and comprises the first process, so that the security and atomicity of the shared data in the process of sharing the data across processes can be improved.

Description

Data cross-process sharing method, terminal equipment and computer readable storage medium
Technical Field
The present application belongs to the technical field of data processing, and in particular, to a method for data cross-process sharing, a terminal device, and a computer-readable storage medium.
Background
An existing terminal device (e.g., a mobile phone) may generally run multiple processes, and data may be shared between different processes, for example, an a application may share some application data thereof to a B application, and such an operation that data is shared between different processes is referred to as cross-process sharing of data.
However, the existing data cross-process sharing mode cannot guarantee the security of shared data, so that the shared data is easily tampered by some malicious processes; and the existing data cross-process sharing mode can not ensure the consistency of the same shared data in different processes, thereby reducing the atomicity of the shared data.
Disclosure of Invention
In view of this, embodiments of the present application provide a data cross-process sharing method, a terminal device, and a computer-readable storage medium, so as to solve the technical problem that the security and atomicity of shared data are low in the existing data cross-process sharing method.
In a first aspect, an embodiment of the present application provides a method for data cross-process sharing, including:
receiving a data processing request from a first process, wherein the data processing request carries a first token, a first identifier of target shared data to be processed and a target data processing strategy of the target shared data;
performing identity verification on the first process based on the first token;
if the identity verification is successful, searching the target shared data from a shared memory based on the first identifier, and processing the target shared data based on the target data processing strategy;
and synchronizing the processed target shared data to each target process, wherein the target process is a process which acquires the target shared data, and the target process comprises the first process.
Optionally, the first identifier is an identifier of the target shared data in a shared memory;
correspondingly, the searching the target shared data from the shared memory based on the first identifier and processing the target shared data based on the target data processing policy includes:
determining a second identification of the target shared data in the first process based on the first identification;
judging whether the target shared data is included in the first process or not based on the second identification;
and if the first process comprises the target shared data, processing the target shared data in the first process based on the target data processing strategy, and synchronizing the processed target shared data into the shared memory.
Optionally, after the determining whether the target shared data is included in the first process based on the second identifier, the method further includes:
if the first process does not include the target shared data, judging whether the shared memory stores the target shared data or not based on the first identifier;
and if the target shared data are stored in the shared memory, processing the target shared data stored in the shared memory based on the target data processing strategy.
Optionally, after determining whether the target shared data is stored in the shared memory based on the first identifier, the method further includes:
and if the target shared data is not stored in the shared memory, returning first prompt information to the first process, wherein the first prompt information is used for prompting that the target shared data does not exist.
Optionally, after the synchronizing the processed target shared data to each target process, the method further includes:
and storing the processed target shared data into a first database.
Optionally, the data processing request further carries an identity of the first process;
correspondingly, the identity verification of the first process based on the first token includes:
analyzing the first token based on a preset decryption strategy to obtain the validity period of the first token and the identity of a process;
and if the current time is within the validity period and the identity of the process obtained by analysis is the same as the identity of the first process carried in the data processing request, confirming that the identity verification is successful.
Optionally, after the identity verification of the first process based on the first token, the method further includes:
and if the identity verification fails, returning second prompt information to the first process, wherein the second prompt information is used for prompting that the first process does not have the authority for processing the target shared data.
In a second aspect, an embodiment of the present application provides a terminal device, including:
the system comprises a request processing unit, a first processing unit and a second processing unit, wherein the request processing unit is used for receiving a data processing request from a first process, and the data processing request carries a first token, a first identifier of target shared data to be processed and a target data processing strategy of the target shared data;
the identity verification unit is used for verifying the identity of the first process based on the first token;
the data processing unit is used for searching the target shared data from the shared memory based on the first identifier and processing the target shared data based on the target data processing strategy if the identity verification is successful;
and the data synchronization unit is used for synchronizing the processed target shared data to each target process, wherein the target process is a process which acquires the target shared data, and the target process comprises the first process.
In a third aspect, an embodiment of the present application provides a terminal device, where the terminal device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the method for sharing data across processes in the first aspect or any optional manner of the first aspect is implemented.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements a method for data cross-process sharing according to the first aspect or any alternative manner of the first aspect.
In a fifth aspect, an embodiment of the present application provides a computer program product, which when run on a terminal device, causes the terminal device to execute the method for data cross-process sharing described in the first aspect or any optional manner of the first aspect.
The implementation of the method for data cross-process sharing, the terminal device, the computer readable storage medium and the computer program product provided by the embodiment of the application has the following beneficial effects:
according to the method for data cross-process sharing provided by the embodiment of the application, the data processing request initiated by the first process carries the first token, the identity of the first process is verified based on the first token when the data processing request initiated by the first process is received, and the target shared data stored in the shared memory is processed based on the target data processing strategy carried in the data processing request after the identity verification is successful, namely the target shared data is processed under the condition that the first process has the authority of processing the target shared data, so that the security of the shared data is improved; after the target shared data is processed, the processed target shared data is synchronized to each process which acquires the target shared data, so that the consistency of the target shared data in different processes can be ensured, and the atomicity of the target shared data is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic structural diagram of a terminal device according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of a method for data cross-process sharing according to an embodiment of the present application;
fig. 3 is a flowchart of a specific implementation of S203 in a method for data cross-process sharing according to an embodiment of the present application;
FIG. 4 is a schematic flow chart diagram illustrating a method for cross-process data sharing according to another embodiment of the present application;
fig. 5 is a schematic structural diagram of a terminal device according to another embodiment of the present application;
fig. 6 is a schematic structural diagram of a terminal device according to yet another embodiment of the present application.
Detailed Description
It is noted that the terminology used in the description of the embodiments of the present application is for the purpose of describing particular embodiments of the present application only and is not intended to be limiting of the present application. In the description of the embodiments of the present application, "/" means "or" unless otherwise specified, for example, a/B may mean a or B; "and/or" herein is merely an associative relationship describing an association, meaning that there may be three relationships, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present application, "a plurality" means two or more, and "at least one", "one or more" means one, two or more, unless otherwise specified.
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a definition of "a first" or "a second" feature may explicitly or implicitly include one or more of the features.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The execution main body of the data cross-process sharing method provided by the embodiment of the application can be terminal equipment. Illustratively, the terminal device may be an electronic device such as a mobile phone, a tablet computer or a notebook computer.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a terminal device according to an embodiment of the present disclosure. As shown in fig. 1, the terminal device may provide a process management service 11, a data storage management service 12, and the like.
The process management service 11 is specifically configured to provide services such as process registration, process monitoring, and processing and/or responding to a request initiated by a process.
Specifically, before a certain process is run for the first time by the terminal device, the process needs to be registered (i.e., created) in the process management service 11. When the terminal device registers a process in the process management service 11, the process management service 11 determines whether the process requested to be registered by the terminal device is a process allowed by the process management service 11.
If the process management service 11 determines that the process requested to be registered by the terminal device is the process allowed by the terminal device, the process management service 11 registers the process and allocates a token for proving the identity of the process to the process after the process is successfully registered.
In one possible implementation, when the terminal device registers a process in the process management service 11, the terminal device may provide the process management service 11 with an identity of the process requesting registration. Illustratively, the identity of the process may include the name or address of the process, etc. Based on this, the token may be generated by the process management service 11 by using a preset encryption policy based on the identity of the process requesting registration and the validity period of the token.
The limited period of the token may be obtained by the process management service 11 according to the first time when the process registration is successful and the preset time length. The preset duration can be set according to actual requirements, and is not limited here. Specifically, the process management service 11 may use a first time as a start time, obtain an end time according to the first time and a preset time length, and describe the validity period of the token by the start time and the end time.
After the process registration is successful, the process management service 11 may monitor the process. E.g., whether the listening process initiated a data processing request, etc. For example, if it is monitored that a process initiates a data processing request, the process management service 11 may process the data to be processed based on the data processing request. Thereafter, the process management service 11 may return the data processing result to the process.
The data storage management service 12 is specifically for providing storage management services for shared data. Shared data refers to data that can be shared between different processes, and shared data can be created by different processes. The data storage management service 12 may store all the shared data created by different processes in the shared memory 13 for unified management, so that each process may obtain the required shared data from the shared memory 13. Illustratively, the shared memory 13 may be a physical memory in the terminal device.
To distinguish between shared data, the data storage management service 12 may identify each shared data stored in the shared memory 13, i.e., different shared data may have different identifications in the shared memory 13. When a process acquires certain shared data from the shared memory 13, the process may also identify the shared data, and different processes may identify the same shared data differently. That is, the same shared data has different identifications in the shared memory 13 and in different processes.
By way of example and not limitation, the identification of the shared data may be a Uniform Resource Identifier (URI) of the shared data.
In this embodiment, the terminal device may perform associated storage on the identifier of the shared data in each process and the identifier of the shared data in the shared memory 13. That is, the terminal device may store a corresponding relationship between the identifier of the shared data in the shared memory 13 and the identifier of the shared data in each process. For example, the terminal device may store a corresponding relationship between an identifier of the shared data in the shared memory 13 and an identifier of the shared data in the first process. Or the terminal device may store a corresponding relationship between the identifier of the shared data in the shared memory 13 and the identifier of the shared data in the second process.
Referring to fig. 2, fig. 2 is a schematic flowchart of a data cross-process sharing method according to an embodiment of the present application. The data cross-process sharing method can comprise S201 to S204, which are detailed as follows:
s201: receiving a data processing request from a first process, wherein the data processing request carries a first token, a first identifier of target shared data to be processed and a target data processing strategy of the target shared data.
In this embodiment of the application, the terminal device may invoke the process management service to execute S201, that is, the process management service may receive the data processing request from the first process.
The first process may be any process running in the terminal device.
When the first process needs to query or update the target shared data, the first process may initiate a data processing request for the target shared data to the process management service. The data processing request may carry a first token, a first identifier of the target shared data, and a target data processing policy for the target shared data.
The target shared data may be shared data created by the first process, or shared data created by other processes except the first process, and is not limited herein.
The first token may be assigned by the process management service to the first process after the registration is successful. Alternatively, the first token may be obtained by the first process from another place, which is not limited herein.
The first identifier of the target shared data refers to an identifier of the target shared data in the shared memory.
By way of example and not limitation, the first process may initiate a data processing request to the process management service by calling an Application Programming Interface (API).
In this embodiment of the application, the data processing request may include: data query requests, data update requests, and the like. The data update request may include: data modification requests, data deletion requests, data write requests, and the like.
In a possible implementation manner, when the data processing request is a data query read request, the target data processing policy carried in the data processing request may specifically be a data query policy. For example, the data query policy may be: querying the target shared data from the first process based on the first identification of the target shared data; and if the query target shared data does not exist in the first process, querying the target shared data from the shared memory based on the first identifier of the target shared data.
In another possible implementation manner, when the data processing request is a data modification request, the target data processing policy carried in the data processing request may specifically be a data modification policy. For example, the data modification policy may be: and modifying the value of the first field of the target shared data into the target value.
In another possible implementation manner, when the data processing request is a data deletion request, the target data processing policy carried in the data processing request may specifically be a data deletion policy. For example, the data deletion policy may be: deleting the target shared data; or delete the target field of the target shared data, etc.
In another possible implementation manner, when the data processing request is a data write request, the target data processing policy carried in the data processing request may specifically be a data write policy. For example, the data write strategy may be: writing the target shared data into the shared memory; or adding a target field in the target shared data, and the like.
S202: and performing identity verification on the first process based on the first token.
In this embodiment of the application, the terminal device may invoke the process management service to execute S202, that is, the process management service may perform identity verification on the first process based on the first token carried in the data processing request.
The token distributed by the process management service for the process is generated by adopting a preset encryption strategy based on the identity of the process and the validity period of the token. Therefore, in an embodiment of the present application, the data processing request may also carry an identity of the first process; s202 may specifically include the following steps:
analyzing the first token based on a preset decryption strategy to obtain the validity period of the first token and the identity of a process;
and if the current time is within the validity period and the identity of the process obtained by analysis is the same as the identity of the first process carried in the data processing request, confirming that the identity verification is successful.
The preset decryption strategy is a decryption strategy corresponding to the preset encryption strategy.
The current time refers to the time when the process management service receives a data processing request from the first process.
In this embodiment, after the process management service analyzes the first token, it may be determined whether the current time is within the validity period of the first token obtained through analysis.
In a possible implementation manner, if the current time is within the validity period of the first token, it indicates that the first token is currently valid, and at this time, the process management service determines whether the identity of the process obtained through the analysis is the same as the identity of the first process carried in the data processing request. In one case, if the identity of the process obtained through the analysis is the same as the identity of the first process carried in the data processing request, the process management service determines that the identity verification of the first process is successful, that is, the first process is a process registered in the process management service. In another case, if the identity of the process obtained through the analysis is different from the identity of the first process carried in the data processing request, the process management service determines that the identity verification of the first process fails, that is, the first process is not a process registered in the process management service.
In another possible manner, if the current time is not within the validity period of the first token, it indicates that the first token is expired currently, and at this time, the process management service determines that the identity check on the first process fails.
In this embodiment, if the identity verification of the first process is successful, the terminal device may execute S203.
S203: and if the identity verification is successful, searching the target shared data from the shared memory based on the first identifier, and processing the target shared data based on the target data processing strategy.
In this embodiment of the application, the terminal device may invoke the process management service and the data storage management service to execute S203.
Specifically, in an embodiment of the present application, if the identity verification of the first process is successful, the process management service may directly search the target shared data from the shared memory based on the first identifier of the target shared data. In one possible case, if the process management service can find the target shared data from the shared memory (i.e., the shared memory stores the target shared data), the data storage management service can process the target shared data based on the target data processing policy. In another possible case, if the process management service cannot find the target shared data from the shared memory (i.e., the shared memory does not store the target shared data), the process management service may return the first prompt message to the first process. The first prompt message is used for prompting that the first process target shared data does not exist.
In another embodiment of the present application, if the identity verification of the first process is successful, the terminal device may execute S2031 to S2033 shown in fig. 3, which are detailed as follows:
s2031: determining a second identification of the target shared data in the first process based on the first identification.
S2032: and judging whether the target shared data is included in the first process or not based on the second identification.
S2033: and if the first process comprises the target shared data, processing the target shared data in the first process based on the target data processing strategy, and synchronizing the processed target shared data into the shared memory.
In this embodiment, the terminal device may invoke the process management service to execute S2031 to S2032, and invoke the process management service and the data storage management service to execute S2033.
Specifically, if the identity of the first process is successfully checked by the process management service, the process management service may determine, based on a first identifier of the target shared data and a correspondence between an identifier of each piece of shared data, which is stored in advance in the terminal device, in the shared memory and an identifier of each piece of target shared data in the first process, a second identifier of the target shared data in the first process.
After the process management service determines the second identifier of the target shared data in the first process, it may determine whether the first process includes the target shared data based on the second identifier. In one possible case, if the process management service can find the target shared data from the first process based on the second identifier, the process management service determines that the target shared data is included in the first process. In another possible case, if the process management service cannot find the target shared data from the first process based on the second identifier, the process management service determines that the target shared data is not included in the first process.
In a possible implementation manner, if the first process includes the target shared data, the data storage management service may process the target shared data in the first process based on the target data processing policy, and synchronize the processed target shared data to the shared memory.
In another possible implementation manner, if the first process does not include the target shared data, the terminal device may execute S2034 to S2035 shown in fig. 3, that is, after S2032, the method for sharing data across processes may further include S2034 to S2035, which is detailed as follows:
s2034: and if the target shared data is not included in the first process, judging whether the shared memory stores the target shared data or not based on the first identifier.
S2035: and if the target shared data are stored in the shared memory, processing the target shared data stored in the shared memory based on the target data processing strategy.
S2036: and if the target shared data is not stored in the shared memory, returning first prompt information to the first process, wherein the first prompt information is used for prompting that the target shared data does not exist.
In this embodiment, if the first process does not include the target shared data, the process management service may determine whether the shared memory stores the target shared data based on the first identifier of the target shared data.
In a possible case, if the process management service determines that the target shared data is stored in the shared memory, the data storage management service may process the target shared data stored in the shared memory based on the target data processing policy. In another possible case, if the process management service determines that the target shared data is not stored in the shared memory, the process management service may return first prompt information to the first process to prompt that the target shared data does not exist in the first process.
S204: and synchronizing the processed target shared data to each target process, wherein the target process is a process which acquires the target shared data, and the target process comprises the first process.
In this embodiment of the application, the terminal device may invoke the data storage management service to execute S204, that is, the data storage management service may synchronize the processed target shared data to each process that has acquired the target shared data. The process of acquiring the target shared data may include the first process and any other process except the first process.
In a possible implementation manner, if the terminal device executes the step S2033 (i.e. processes the target shared data in the first process), the data storage management service may not synchronize the processed target shared data stored in the shared memory to the first process.
In another possible case, if the terminal device does not execute S2033, but directly processes the target shared data stored in the shared memory, the data storage management service needs to synchronize the processed target shared data stored in the shared memory to the first process.
As can be seen from the above, in the method for sharing data across processes provided in this embodiment, because the data processing request initiated by the first process carries the first token, and when the data processing request initiated by the first process is received, the identity of the first process is verified based on the first token, and after the identity is successfully verified, the target shared data stored in the shared memory is processed based on the target data processing policy carried in the data processing request, that is, the target shared data is processed only when the first process has the right to process the target shared data, so that the security of the shared data is improved; after the target shared data is processed, the processed target shared data is synchronized to each process which acquires the target shared data, so that the consistency of the target shared data in different processes is ensured, and the atomicity of the target shared data is improved.
Referring to fig. 4, fig. 4 is a schematic flowchart of a data cross-process sharing method according to another embodiment of the present application. As shown in fig. 4, the difference between this embodiment and the embodiment corresponding to fig. 2 is that this embodiment may further include S205 after S202, which is detailed as follows:
s205: and if the identity verification fails, returning second prompt information to the first process, wherein the second prompt information is used for prompting that the first process does not have the authority for processing the target shared data.
In this embodiment, the terminal device may invoke the process management service to execute S205, that is, if the identity verification of the first process fails, the process management service may return the second prompt message to the first process to prompt that the first process has no authority to process the target shared data.
As can be seen from the above, in the data cross-process sharing method provided in this embodiment, when the first process does not have the right to process the target shared data, the first process may be prompted, so that the first process may know the reason why the first process cannot process the target shared data.
Referring to fig. 4, in another embodiment of the present application, after S203, the method for data cross-process sharing may further include S206, which is detailed as follows:
s206: and storing the processed target shared data into a first database.
In this embodiment, the terminal device may invoke the data storage management service to execute S206, that is, the data storage management service may store the processed target shared data in the first database.
The first data may be a distributed database or a centralized database, and the type of the first database is not particularly limited herein.
It should be noted that, the terminal device may perform S205 first, and then perform S206; alternatively, the terminal device may perform S206 first, and then perform S205; alternatively, the terminal device may perform S205 and S206 simultaneously.
As can be seen from the above, in the method for sharing data across processes provided in this embodiment, since the shared data is backed up in the first database, when the shared data stored in the shared memory is lost, the terminal device may obtain the shared data from the first database and copy the shared data to the shared memory, so that it can be ensured that the shared data is recovered in time when the shared data in the shared memory has a problem.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Based on the method for data cross-process sharing provided by the above embodiment, the embodiment of the present invention further provides an embodiment of a terminal device implementing the above method embodiment. Referring to fig. 5, fig. 5 is a schematic structural diagram of a terminal device according to another embodiment of the present application. For convenience of explanation, only the portions related to the present embodiment are shown. As shown in fig. 5, the terminal device 50 may include: a request processing unit 51, an identity verification unit 52, a data processing unit 53 and a data synchronization unit 54. Wherein:
the request processing unit 51 is configured to receive a data processing request from a first process, where the data processing request carries a first token, a first identifier of target shared data to be processed, and a target data processing policy of the target shared data.
The identity verification unit 52 is configured to verify the identity of the first process based on the first token.
The data processing unit 53 is configured to, if the identity verification is successful, search the target shared data from the shared memory based on the first identifier, and process the target shared data based on the target data processing policy.
The data synchronization unit 54 is configured to synchronize the processed target shared data to each target process, where the target process is a process that has acquired the target shared data, and the target process includes the first process.
Optionally, the first identifier is an identifier of the target shared data in a shared memory. Correspondingly, the data processing unit 53 may specifically include: the device comprises a first determining unit, a first judging unit and a first processing unit. Wherein:
the first determination unit is used for determining a second identification of the target shared data in the first process based on the first identification.
The first judging unit is used for judging whether the target shared data is included in the first process or not based on the second identifier.
The first processing unit is configured to, if the first process includes the target shared data, process the target shared data in the first process based on the target data processing policy, and synchronize the processed target shared data to the shared memory.
Optionally, the first determining unit may specifically include: the device comprises a data judgment unit and a second processing unit. Wherein:
the data determining unit is configured to determine whether the shared memory stores the target shared data based on the first identifier if the first process does not include the target shared data.
The second processing unit is configured to, if the target shared data is stored in the shared memory, process the target shared data stored in the shared memory based on the target data processing policy.
Optionally, the first determining unit further includes a first prompting unit.
The first prompting unit is configured to return first prompting information to the first process if the target shared data is not stored in the shared memory, where the first prompting information is used to prompt that the target shared data does not exist.
Optionally, the terminal device further includes a data backup unit.
The data backup unit is used for storing the processed target shared data into a first database.
Optionally, the data processing request further carries an identity of the first process. Correspondingly, the identity verification unit 52 may specifically include: the device comprises an analysis unit and a verification unit. Wherein:
the analysis unit is used for analyzing the first token based on a preset decryption strategy to obtain the validity period of the first token and the identity of one process.
And the verification unit is used for confirming that the identity verification is successful if the current time is within the validity period and the identity of the process obtained by analysis is the same as the identity of the first process carried in the data processing request.
Optionally, the terminal device further includes a second prompting unit.
And the second prompting unit is used for returning second prompting information to the first process if the identity verification fails, wherein the second prompting information is used for prompting that the first process does not have the authority of processing the target shared data.
It should be noted that, because the contents of information interaction, execution process, and the like between the modules are based on the same concept as that of the embodiment of the method of the present application, specific functions and technical effects thereof may be referred to specifically in the embodiment of the method, and are not described herein again.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional units and modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional units and modules as needed, that is, the internal structure of the terminal device is divided into different functional units or modules to perform all or part of the above described functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a terminal device according to another embodiment of the present application. As shown in fig. 6, the terminal device 6 provided in this embodiment may include: a processor 60, a memory 61, and a computer program 62 stored in the memory 61 and operable on the processor 60, such as a program corresponding to a method of data cross-process sharing. The processor 60, when executing the computer program 62, implements the steps in the above-described method embodiments of data sharing across processes, such as S201 to S204 shown in fig. 2. Alternatively, the processor 60, when executing the computer program 62, implements the functions of the modules/units in the terminal device embodiments described above, such as the functions of the units 51-54 shown in fig. 5.
Illustratively, the computer program 62 may be divided into one or more modules/units, which are stored in the memory 61 and executed by the processor 60 to accomplish the present application. One or more of the modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 62 in the terminal device 6. For example, the computer program 62 may be divided into a request processing unit, an identity checking unit, a data processing unit and a data synchronization unit, and the specific functions of each unit are described with reference to the related description in the embodiment corresponding to fig. 5, which is not described herein again.
Those skilled in the art will appreciate that fig. 6 is merely an example of a terminal device 6 and does not constitute a limitation of terminal device 6, and may include more or less components than those shown, or some components in combination, or different components.
The processor 60 may be a Central Processing Unit (CPU), other general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 61 may be an internal storage unit of the terminal device 6, such as a hard disk or a memory of the terminal device 6. The memory 61 may also be an external storage device of the terminal device 6, such as a plug-in hard disk, a Smart Memory Card (SMC), a Secure Digital (SD) card, or a flash memory card (flash card) provided on the terminal device 6. Further, the memory 61 may also include both an internal storage unit of the terminal device 6 and an external storage device. The memory 61 is used for storing computer programs and other programs and data required by the terminal device. The memory 61 may also be used to temporarily store data that has been output or is to be output.
The embodiments of the present application further provide a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
The embodiments of the present application provide a computer program product, which when running on a terminal device, enables the terminal device to implement the steps in the above method embodiments when executed.
In the above embodiments, the description of each embodiment has its own emphasis, and parts that are not described or illustrated in a certain embodiment may refer to the description of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A method for data cross-process sharing, comprising:
receiving a data processing request from a first process, wherein the data processing request carries a first token, a first identifier of target shared data to be processed and a target data processing strategy of the target shared data;
performing identity verification on the first process based on the first token;
if the identity verification is successful, searching the target shared data from a shared memory based on the first identifier, and processing the target shared data based on the target data processing strategy;
and synchronizing the processed target shared data to each target process, wherein the target process is a process which acquires the target shared data, and the target process comprises the first process.
2. The method of claim 1, wherein the first identifier is an identifier of the target shared data in a shared memory;
correspondingly, the searching the target shared data from the shared memory based on the first identifier and processing the target shared data based on the target data processing policy includes:
determining a second identification of the target shared data in the first process based on the first identification;
judging whether the target shared data is included in the first process or not based on the second identification;
and if the first process comprises the target shared data, processing the target shared data in the first process based on the target data processing strategy, and synchronizing the processed target shared data into the shared memory.
3. The method of claim 2, wherein after the determining whether the target shared data is included in the first process based on the second identifier, the method further comprises:
if the first process does not include the target shared data, judging whether the shared memory stores the target shared data or not based on the first identifier;
and if the target shared data are stored in the shared memory, processing the target shared data stored in the shared memory based on the target data processing strategy.
4. The method according to claim 3, wherein after said determining whether the target shared data is stored in the shared memory based on the first identifier, the method further comprises:
and if the target shared data is not stored in the shared memory, returning first prompt information to the first process, wherein the first prompt information is used for prompting that the target shared data does not exist.
5. The method according to any one of claims 1 to 4, wherein after the synchronizing the processed target shared data to the respective target processes, the method further comprises:
and storing the processed target shared data into a first database.
6. The method according to any one of claims 1 to 4, wherein the data processing request further carries an identity of the first process;
correspondingly, the identity verification of the first process based on the first token includes:
analyzing the first token based on a preset decryption strategy to obtain the validity period of the first token and the identity of a process;
and if the current time is within the validity period and the identity of the process obtained by analysis is the same as the identity of the first process carried in the data processing request, confirming that the identity verification is successful.
7. The method of any of claims 1 to 4, wherein after said identity checking the first process based on the first token, the method further comprises:
and if the identity verification fails, returning second prompt information to the first process, wherein the second prompt information is used for prompting that the first process does not have the authority for processing the target shared data.
8. A terminal device, comprising:
the system comprises a request processing unit, a first processing unit and a second processing unit, wherein the request processing unit is used for receiving a data processing request from a first process, and the data processing request carries a first token, a first identifier of target shared data to be processed and a target data processing strategy of the target shared data;
the identity verification unit is used for verifying the identity of the first process based on the first token;
the data processing unit is used for searching the target shared data from the shared memory based on the first identifier and processing the target shared data based on the target data processing strategy if the identity verification is successful;
and the data synchronization unit is used for synchronizing the processed target shared data to each target process, wherein the target process is a process which acquires the target shared data, and the target process comprises the first process.
9. A terminal device comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, the processor implementing the method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
CN202110993490.XA 2021-08-27 2021-08-27 Data cross-process sharing method, terminal equipment and computer readable storage medium Pending CN113779545A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110993490.XA CN113779545A (en) 2021-08-27 2021-08-27 Data cross-process sharing method, terminal equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110993490.XA CN113779545A (en) 2021-08-27 2021-08-27 Data cross-process sharing method, terminal equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN113779545A true CN113779545A (en) 2021-12-10

Family

ID=78839795

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110993490.XA Pending CN113779545A (en) 2021-08-27 2021-08-27 Data cross-process sharing method, terminal equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113779545A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112702306A (en) * 2019-10-23 2021-04-23 中国移动通信有限公司研究院 Intelligent service sharing method, device, equipment and storage medium
CN114422965A (en) * 2022-01-14 2022-04-29 Tcl通讯科技(成都)有限公司 Information interaction method and device, storage medium and electronic equipment
CN115016957A (en) * 2022-05-26 2022-09-06 湖南三一智能控制设备有限公司 Method, device, terminal and vehicle for cross-process memory sharing

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739361A (en) * 2008-11-12 2010-06-16 联想(北京)有限公司 Access control method, access control device and terminal device
CN103514053A (en) * 2013-09-22 2014-01-15 中国科学院信息工程研究所 Shared-memory-based method for conducting communication among multiple processes
FR2993683A1 (en) * 2012-07-20 2014-01-24 Morpho METHOD FOR MANAGING EXECUTIVE WIRES IN A COMPUTER UNIT AND AGENCY COMPUTER UNIT FOR CARRYING OUT SAID METHOD
CN104268012A (en) * 2014-09-28 2015-01-07 广州华多网络科技有限公司 Picture data processing method and device
CN107172102A (en) * 2017-07-13 2017-09-15 上海联影医疗科技有限公司 Data access method, system and storage medium
CN107483509A (en) * 2017-10-09 2017-12-15 武汉斗鱼网络科技有限公司 A kind of auth method, server and readable storage medium storing program for executing
CN109492379A (en) * 2018-11-28 2019-03-19 北京云纵信息技术有限公司 A kind of data safety call method and device
CN110069346A (en) * 2019-04-26 2019-07-30 杭州迪普科技股份有限公司 Resource share method, device, electronic equipment between multi-process
CN110298165A (en) * 2018-03-22 2019-10-01 腾讯科技(深圳)有限公司 Have secure access to method, apparatus and the authentication proxy of shared drive
CN111367687A (en) * 2020-02-28 2020-07-03 罗普特科技集团股份有限公司 Inter-process data communication method and device
CN111813584A (en) * 2020-08-05 2020-10-23 Oppo广东移动通信有限公司 Memory sharing method and device, electronic equipment and storage medium
CN112099979A (en) * 2020-11-18 2020-12-18 数字广东网络建设有限公司 Access control method, device, computer equipment and storage medium
CN113158198A (en) * 2020-01-22 2021-07-23 华为技术有限公司 Access control method, device, terminal equipment and storage medium

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739361A (en) * 2008-11-12 2010-06-16 联想(北京)有限公司 Access control method, access control device and terminal device
FR2993683A1 (en) * 2012-07-20 2014-01-24 Morpho METHOD FOR MANAGING EXECUTIVE WIRES IN A COMPUTER UNIT AND AGENCY COMPUTER UNIT FOR CARRYING OUT SAID METHOD
CN103514053A (en) * 2013-09-22 2014-01-15 中国科学院信息工程研究所 Shared-memory-based method for conducting communication among multiple processes
CN104268012A (en) * 2014-09-28 2015-01-07 广州华多网络科技有限公司 Picture data processing method and device
CN107172102A (en) * 2017-07-13 2017-09-15 上海联影医疗科技有限公司 Data access method, system and storage medium
CN107483509A (en) * 2017-10-09 2017-12-15 武汉斗鱼网络科技有限公司 A kind of auth method, server and readable storage medium storing program for executing
CN110298165A (en) * 2018-03-22 2019-10-01 腾讯科技(深圳)有限公司 Have secure access to method, apparatus and the authentication proxy of shared drive
CN109492379A (en) * 2018-11-28 2019-03-19 北京云纵信息技术有限公司 A kind of data safety call method and device
CN110069346A (en) * 2019-04-26 2019-07-30 杭州迪普科技股份有限公司 Resource share method, device, electronic equipment between multi-process
CN113158198A (en) * 2020-01-22 2021-07-23 华为技术有限公司 Access control method, device, terminal equipment and storage medium
CN111367687A (en) * 2020-02-28 2020-07-03 罗普特科技集团股份有限公司 Inter-process data communication method and device
CN111813584A (en) * 2020-08-05 2020-10-23 Oppo广东移动通信有限公司 Memory sharing method and device, electronic equipment and storage medium
CN112099979A (en) * 2020-11-18 2020-12-18 数字广东网络建设有限公司 Access control method, device, computer equipment and storage medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112702306A (en) * 2019-10-23 2021-04-23 中国移动通信有限公司研究院 Intelligent service sharing method, device, equipment and storage medium
CN112702306B (en) * 2019-10-23 2023-05-09 中国移动通信有限公司研究院 Method, device, equipment and storage medium for intelligent service sharing
CN114422965A (en) * 2022-01-14 2022-04-29 Tcl通讯科技(成都)有限公司 Information interaction method and device, storage medium and electronic equipment
CN114422965B (en) * 2022-01-14 2023-08-15 Tcl通讯科技(成都)有限公司 Information interaction method and device, storage medium and electronic equipment
CN115016957A (en) * 2022-05-26 2022-09-06 湖南三一智能控制设备有限公司 Method, device, terminal and vehicle for cross-process memory sharing
CN115016957B (en) * 2022-05-26 2024-03-22 湖南三一智能控制设备有限公司 Method, device, terminal and vehicle for cross-process memory sharing

Similar Documents

Publication Publication Date Title
CN108810006B (en) Resource access method, device, equipment and storage medium
CN108923908B (en) Authorization processing method, device, equipment and storage medium
US11258612B2 (en) Method, apparatus, and electronic device for blockchain-based recordkeeping
CN110414268B (en) Access control method, device, equipment and storage medium
CN113779545A (en) Data cross-process sharing method, terminal equipment and computer readable storage medium
CN111163182B (en) Block chain-based device registration method and apparatus, electronic device, and storage medium
CN109766349B (en) Task duplicate prevention method, device, computer equipment and storage medium
CN113656780B (en) Cross-chain access control method and device
CN109474600B (en) Account binding method, system, device and equipment
CN109831435B (en) Database operation method, system, proxy server and storage medium
WO2020173019A1 (en) Access certificate verification method and device, computer equipment and storage medium
CN111340483A (en) Data management method based on block chain and related equipment
WO2020000716A1 (en) Big data analysis system, server, data processing method, program and storage medium
CN111159657A (en) Application program authentication method and system
CN111400355B (en) Data query method and device
CN111796936A (en) Request processing method and device, electronic equipment and medium
CN113591121A (en) Resource access authority configuration method, device, equipment and storage medium
CN105183799A (en) Authority management method and client
CN111090616B (en) File management method, corresponding device, equipment and storage medium
CN110677391B (en) Third-party link verification method based on URL Scheme technology and related equipment
CN109710692B (en) User information processing method and device in block chain network and storage medium
CN114584313B (en) Equipment physical identity authentication method, system, device and first platform
CN112445705B (en) Software running system, method and device based on trusted verification and computer equipment
CN116010926A (en) Login authentication method, login authentication device, computer equipment and storage medium
CN112583890B (en) Message pushing method and device based on enterprise office system and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination