CN116225409A - Cross-application object dragging method and device, terminal equipment and storage medium - Google Patents

Cross-application object dragging method and device, terminal equipment and storage medium Download PDF

Info

Publication number
CN116225409A
CN116225409A CN202211714706.5A CN202211714706A CN116225409A CN 116225409 A CN116225409 A CN 116225409A CN 202211714706 A CN202211714706 A CN 202211714706A CN 116225409 A CN116225409 A CN 116225409A
Authority
CN
China
Prior art keywords
serialized data
writing
application
dragging
data
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
CN202211714706.5A
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 CN202211714706.5A priority Critical patent/CN116225409A/en
Publication of CN116225409A publication Critical patent/CN116225409A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application is applicable to the technical field of computers, and provides a cross-application object dragging method, a device, terminal equipment and a storage medium, wherein the method comprises the following steps: when a cross-application drag event is detected, the first application program converts object data of a dragged object into serialized data, and the serialized data is written into a shared memory; after the writing of the serialized data is completed, the second application program reads the serialized data from the shared memory and performs deserialization operation according to the serialized data, an object instance is created in the second application program, the serialized data is stored by using the shared memory, and the application program for placing the object can generate an object instance identical to the dragged object in the second application program by accessing the serialized data in the shared memory and performing deserialization operation, so that object dragging across applications is realized, and the problem that object dragging between two applications is difficult to realize at present is solved.

Description

Cross-application object dragging method and device, terminal equipment and storage medium
Technical Field
The application belongs to the technical field of computers, and particularly relates to a cross-application object dragging method, a device, terminal equipment and a storage medium.
Background
The application developer is independent in developing and compiling the application, and thus each application installation package generated is independent. Therefore, when each application program is operated by the terminal, namely, each application program is operated in an independent process, so that the stable operation of each application program is ensured.
However, such an application mechanism of independent compiling and independent running also causes that the functional modules of the respective applications, page jump logic, etc. are completely determined at the time of development, and it is difficult to realize object dragging between two applications.
Disclosure of Invention
The embodiment of the application provides a cross-application object dragging method, a device, terminal equipment and a storage medium, which can realize cross-application object dragging.
In a first aspect, an embodiment of the present application provides a cross-application object dragging method, including:
when a cross-application drag event is detected, converting object data of a dragged object into serialized data by a first application program, and writing the serialized data into a shared memory;
and after the writing of the serialized data is completed, the second application program reads the serialized data from the shared memory, and performs deserialization operation according to the serialized data, so as to create an object instance in the second application program.
In a possible implementation manner of the first aspect, before the first application program converts object data of the dragged object into serialized data, the method further includes:
judging whether the dragged object is an integrity object or not;
if the dragged object is an integrity object, converting object data of the dragged object into serialized data; otherwise, feedback the invalid drag information.
In a possible implementation manner of the first aspect, when the cross-application drag event is detected, the converting, by the first application program, object data of the dragged object into serialized data, and writing the serialized data into the shared memory, includes:
when a cross-application drag event is detected, when a drag mark position is idle, a first application program takes the drag mark position as the drag position;
the writing completion identification position is the incomplete writing;
carrying out serialization conversion on the object data of the dragged object to obtain serialized data;
and allocating a first buffer area for the serialized data from the shared memory, writing the serialized data into the first buffer area, and taking the writing completion identification position as the completion writing after the writing is completed.
In a possible implementation manner of the first aspect, after allocating a first buffer area for the serialized data from the shared memory, writing the serialized data into the first buffer area, and after writing, setting the writing completion identification position to be the completion of writing, the method further includes:
and calculating a check code according to the serialized data, and writing the check code into a check area.
In a possible implementation manner of the first aspect, after the writing of the serialized data is completed, a second application program reads the serialized data from the shared memory, performs a deserialization operation according to the serialized data, and creates an object instance in the second application program, where the creating includes:
the second application program accesses the drag identification bit and the writing completion identification bit;
if the dragging identification bit is in dragging, and the writing completion identification bit is writing completion, the dragging identification bit is occupied, and a second cache area is created in the exclusive process memory of the second application degree according to the data quantity of the serialization information;
reading the serialized data from the first cache region, writing the read serialized data into the second cache region, and after writing is completed, setting the dragging identification position as idle;
and performing deserialization operation according to the serialized data in the second buffer area to obtain an object instance.
In a possible implementation manner of the first aspect, the reading the serialized data from the first buffer area, writing the read serialized data into the second buffer area, and after writing, after the writing is completed, setting the drag identifier position to be idle, further includes:
and reading a check code and checking the serialized data.
In a possible implementation manner of the first aspect, after the writing of the serialized data is completed, the second application program reads the serialized data from the shared memory, performs a deserialization operation according to the serialized data, and after creating an object instance in the second application program, the method further includes:
and releasing the shared memory.
In a second aspect, an embodiment of the present application provides an object dragging device across applications, including:
the conversion module is used for converting object data of a dragged object into serialized data by the first application program when a cross-application dragging event is detected, and writing the serialized data into the shared memory;
and the creation module is used for reading the serialized data from the shared memory by the second application program after the serialized data is written, performing deserialization operation according to the serialized data and creating an object instance in the second application program.
In a third aspect, an embodiment of the present application provides a terminal device, including: a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the method according to the first aspect when executing the computer program.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program which, when executed by a processor, implements a method according to the first aspect.
In a fifth aspect, embodiments of the present application provide a computer program product for causing a terminal device to perform the method of the first aspect described above when the computer program product is run on the terminal device.
It will be appreciated that the advantages of the second to fifth aspects may be found in the relevant description of the first aspect, and are not described here again.
Compared with the prior art, the embodiment of the application has the beneficial effects that: by carrying out serialization operation on the dragged object and storing the serialization data by utilizing the shared memory, an application program for placing the object can generate an object instance identical to the dragged object in a second application program by accessing the serialization data in the shared memory and carrying out deserialization operation, so that object dragging across applications is realized, and the problem that object dragging between two applications is difficult to realize at present is solved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following description will briefly introduce the drawings that are needed in the embodiments or the description of the prior art, it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic implementation flow diagram of a cross-application object dragging method provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of an implementation of S101 of a cross-application object dragging method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a shared memory according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating an implementation of S102 of a cross-application object dragging method according to an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a cross-application object dragging device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in this specification and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
In addition, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used merely to distinguish between descriptions and are not to be construed as indicating or implying relative importance.
Reference in the 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 application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
In order to solve the problem that it is difficult to realize object dragging between two applications at present, that is, it is difficult to drag and place an object in a first application program into a second application program, and the second application program displays and operates the object. The embodiment of the application provides a cross-application object dragging method, which is characterized in that a dragging object is subjected to serialization operation, and the serialization data is stored by utilizing a shared memory, so that an application program for placing the object can generate an object instance identical to the dragged object in a second application program by accessing the serialization data in the shared memory and performing deserialization operation, thereby realizing cross-application object dragging, and solving the problem that the object dragging between two applications is difficult to realize at present.
The following describes a cross-application object dragging method provided by an embodiment of the present application with reference to the accompanying drawings:
referring to fig. 1, fig. 1 is a schematic implementation flow diagram of an object dragging method across applications provided in an embodiment of the present application. In this embodiment of the present application, the executing body of the above-mentioned cross-application corresponding drag method may be a terminal device, where the terminal device includes, but is not limited to, a mobile phone, a wearable device (such as a smart watch, a smart bracelet, a smart glasses, a smart jewelry, etc.), a tablet computer, a vehicle-mounted device, an augmented reality (augmented reality, AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (personal digital assistant, PDA), and other electronic devices, which are not specifically limited herein. The electronic apparatus may be configured with an input device, and input operations by a user are received by the input device. The input device may be a mouse, a touch pad, a touch screen, etc., which is not particularly limited in this application.
As shown in fig. 1, the above cross-application object dragging method may include S101 to S102, which are described in detail as follows:
s101: when a cross-application drag event is detected, the first application program converts object data of the dragged object into serialized data, and writes the serialized data into a shared memory.
In a specific application, when a user inputs a drag operation through the input device, the terminal device may detect a drag event. Taking the input device as an example, when a user selects and drags an object in the first application program through the mouse, the terminal device can detect a drag event, including information such as a drag object, drag time, drop position, and the like.
When the terminal device detects a drag event, it may first determine whether the drag event is a cross-application drag event, and if the drag event is a cross-application drag event, it indicates that a dragged object in the first application program needs to be synchronized to the second application program, so that the first application program may save object data of the dragged object in a form of serialized data in the shared memory.
It should be noted that, the terminal device may determine whether the drag event is a cross-application drag event according to the drop position of the drag event, that is, if the drop position of the drag event is a display interface of another application program, it may determine that the drag event is a cross-application drag event.
In a specific application, serialization (Serialization) is a process of converting the state information of an object into a form that can be stored or transmitted.
Based on this, before the first application program converts the object data of the dragged object into the serialized data, it is necessary to further determine whether the dragged object is an integrity object. Only the integrity object can be serialized, i.e. only the dragged object is an integrity object, the object data of the dragged object can be converted into serialized data. If the dragged object is not the integrity object, feedback of invalid drag information.
It should be noted that the object data of the dragged object includes all fields of the object instance. The serialization process may be to serialize all fields of an object instance one by one and store one by one in key-value pairs.
The shared memory is a mode of inter-process communication, and processes of different application programs can access the same section of memory space simultaneously, so that information sharing is realized.
It should be noted that, an application program is equivalent to an installation-free or application program installation package downloaded on the internet, after the package is decompressed or installed, the package is stored in a certain position of the hard disk in a persistent storage mode, after the executable file of the application program is opened by double clicking and right clicking, a process object is allocated in the system of the terminal device, and a user can check the process running in the system through the task manager of the terminal device.
S102: and after the writing of the serialized data is completed, the second application program reads the serialized data from the shared memory, and performs deserialization operation according to the serialized data, so as to create an object instance in the second application program.
It should be noted that, the second application in the embodiment of the present application refers to a target application for placing the object in the drag operation, that is, the user drags the object in the first application to the second application to release the object.
In a specific application, when a first application program converts object data of a dragged object into serialized data and writes the serialized data into a shared memory, a second application program can read the serialized data of the dragged object from the shared memory, and perform deserialization operation in a reflection system and other modes, so that the serialized data can be recovered into the object data, and further an object instance identical to the dragged object is created in the second application program, thus completing cloning of the object and realizing dragging of the object.
The deserialization operation is a reverse process of serialization, and when the terminal device executes the deserialization operation, the key value pair can be read, and data recovery is performed according to the key value pair.
In summary, it can be seen that according to the cross-application object dragging method provided by the embodiment of the application, the object to be dragged can be serialized through the object to be dragged, the serialized data is stored by using the shared memory, the application program for placing the object can generate an object instance identical to the object to be dragged in the second application program through accessing the serialized data in the shared memory and performing the anti-serialization operation, so that the cross-application object dragging is realized, and the problem that the object dragging between two applications is difficult to realize at present is solved.
Referring to fig. 2, fig. 2 shows an implementation flow of S101 of the cross-application object dragging method provided in the embodiment of the present application.
As shown in fig. 2, in an embodiment of the present application, the step S101 may include the following steps:
s1011: and when a cross-application drag event is detected, the first application program takes the drag mark position as the drag state when the drag mark position is idle.
In a specific application, referring to fig. 3, the shared memory may include a drag flag bit, a write completion flag bit, a dragged object information storage area, a cache area, and a check area. The drag mark bit can occupy 1 byte, the writing completion mark bit can occupy 1 byte, the dragged object information storage area (mainly used for describing how long the serialization information is stored) can occupy 4 bytes, the check area can occupy 4 bytes, and the length of the buffer area can be dynamically allocated.
The drag identification bit is used for identifying the current drag state and can comprise states of in-drag, idle, occupied and the like.
In a specific application, the drag state may be represented by a specific numerical value or character, for example, the drag may be set to "1", the idle may be set to "0", and the occupancy may be set to "2". It will be appreciated that the different states may be represented using other characters or values, which are exemplary only and not limiting.
When the drag flag bit meets the drag requirement, the state of the drag flag bit is an idle state, and when the object in other application programs is dragged, the occupied/drag state is written in the drag flag bit, so that the first application program cannot execute subsequent operations, and the read-write conflict can be effectively avoided.
In a specific application, when a terminal device detects a cross-application drag event and a first application program accesses a drag identification bit in a shared memory, and the drag identification bit is idle, the first application program takes the drag identification bit as the drag to occupy the shared memory to store serialized object data.
S1012: the write completion identification location is the incomplete write.
In a specific application, a writing completion identification bit is further arranged in the shared memory to judge whether the serialized data is written or not.
Likewise, the write status may be represented by a specific numerical value or character, for example, an incomplete write may be set to "0" and a complete write may be set to "1". It will be appreciated that the different states may be represented using other characters or values, which are exemplary only and not limiting.
In a specific application, if the drag flag is changed from idle to drag, the terminal device may simultaneously set the writing completion flag to an incomplete writing.
S1013: and carrying out serialization conversion on the object data of the dragged object to obtain serialized data.
In a specific application, the serialization conversion of the object data of the dragged object may be performed synchronously or asynchronously, and may be determined according to the data size of the object data of the dragged object, which is not specifically limited in the present application.
In a specific application, the serialized data may be a serialized byte stream or a serialized array, which is not limited in this application.
S1014: and allocating a first buffer area for the serialized data from the shared memory, writing the serialized data into the first buffer area, and taking the writing completion identification position as the completion writing after the writing is completed.
In a specific application, the terminal device may dynamically allocate the first buffer area according to the length of the serialized data (specifically, the length of the serialized byte stream).
In order to improve the security of data, in the embodiment of the present application, after the serialized data is obtained, check data is further added on the basis of the serialized data. Specifically, the CRC32 calculation may be performed according to the serialized data, and then the obtained check code is written into the check area of the shared memory.
When the serialized data is asynchronously written, in order to avoid read-write collision, the writing completion identification bit is required to be accessed before each writing, and only if the writing completion identification bit is writing completion, the writing can be continued.
Based on this, referring to fig. 4, S102 provided in the embodiment of the present application may include the following steps:
s1021: the second application accesses the drag flag bit and the write completion flag bit.
S1022: and if the dragging identification bit is in dragging, and the writing completion identification bit is in writing completion, the dragging identification bit is occupied, and a second buffer area is created in the exclusive process memory of the second application degree according to the data quantity of the serialization information.
In a specific application, the dragging identification position is occupied, so that other application programs can be prevented from using the section of shared memory, and the exclusive operation is realized.
If the drag flag bit is not in the drag or the write completion flag bit is not write completion, no operation is performed, and the drag flag bit is regarded as invalid drag behavior.
S1023: and reading the serialized data from the first buffer area, writing the read serialized data into the second buffer area, and after the writing is completed, setting the dragging identification position as idle.
Further, in order to determine the security of the data, after the data is written into the second buffer, the data written into the second buffer needs to be checked, specifically, a check code may be read, and then CRC check is performed.
When the drag mark position is reset to be idle, the wheel drag task is completed.
S1024: and performing deserialization operation according to the serialized data in the second buffer area to obtain an object instance.
In a specific application, after the object instance is established, the first buffer area and the second buffer area may also be released.
Corresponding to the cross-application object dragging method described in the above embodiments, fig. 5 shows a block diagram of the cross-application object dragging device provided in the embodiment of the present application, and for convenience of explanation, only the portion relevant to the embodiment of the present application is shown.
Referring to fig. 5, the cross-application object dragging device 50 may include: a conversion module 51 and a creation module 52. Wherein:
the conversion module 51 is configured to, when a cross-application drag event is detected, convert object data of a dragged object into serialized data by the first application program, and write the serialized data into the shared memory.
The creation module 52 is configured to, after writing of the serialized data is completed, read the serialized data from the shared memory by a second application program, and perform a deserialization operation according to the serialized data, so as to create an object instance in the second application program.
In one possible implementation manner, the cross-application object dragging device further includes a judging module. The judging module is used for judging whether the dragged object is an integrity object or not; if the dragged object is an integrity object, converting object data of the dragged object into serialized data; otherwise, feedback the invalid drag information.
In a possible implementation manner, the conversion module 51 is specifically configured to, when a cross-application drag event is detected, make a drag mark position be in drag when a drag mark position is idle by a first application program;
the writing completion identification position is the incomplete writing;
carrying out serialization conversion on the object data of the dragged object to obtain serialized data;
and allocating a first buffer area for the serialized data from the shared memory, writing the serialized data into the first buffer area, and taking the writing completion identification position as the completion writing after the writing is completed.
In a possible implementation, the conversion module 51 is further configured to calculate a check code according to the serialized data, and write the check code into a check area.
In one possible implementation, the creation module 52 is specifically configured to access the drag flag and the write completion flag by the second application;
if the dragging identification bit is in dragging, and the writing completion identification bit is writing completion, the dragging identification bit is occupied, and a second cache area is created in the exclusive process memory of the second application degree according to the data quantity of the serialization information;
reading the serialized data from the first cache region, writing the read serialized data into the second cache region, and after writing is completed, setting the dragging identification position as idle;
and performing deserialization operation according to the serialized data in the second buffer area to obtain an object instance.
In one possible implementation, the creation module 52 is further configured to read a check code and check the serialized data.
In one possible implementation, the cross-application object dragging device 50 further includes a release module.
And the release module is used for releasing the shared memory.
It should be noted that, because the content of information interaction and execution process between the above devices/units is based on the same concept as the method embodiment of the present application, specific functions and technical effects thereof may be referred to in the method embodiment section, and will not be described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a 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 process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
In summary, it can be seen that, in the cross-application object dragging device provided in the embodiment of the present application, the object to be dragged can be also serialized by using the shared memory to store the serialized data, and the application program placing the object can generate an object instance identical to the object to be dragged in the second application program by accessing the serialized data in the shared memory and performing the anti-serialization operation, so as to achieve cross-application object dragging, and solve the problem that it is difficult to achieve object dragging between two applications at present.
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 of this embodiment includes: at least one processor 60 (only one shown in fig. 6), a memory 61, and a computer program 62 stored in the memory 61 and executable on the at least one processor 60, the processor 60 implementing the steps in any of the cross-application object dragging method embodiments described above when executing the computer program 62.
The terminal device may include, but is not limited to, a processor 60, a memory 61. It will be appreciated by those skilled in the art that fig. 6 is merely an example of the terminal device 6 and is not meant to be limiting as to the terminal device 6, and may include more or fewer components than shown, or may combine certain components, or different components, such as may also include input-output devices, network access devices, etc.
The processor 60 may be a central processing unit (Central Processing Unit, CPU), the processor 60 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 61 may in some embodiments 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 in other embodiments also be an external storage device of the terminal device 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the terminal device 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the terminal device 6. The memory 61 is used for storing an operating system, application programs, boot loader (BootLoader), data, other programs, etc., such as program codes of the computer program. The memory 61 may also be used for temporarily storing data that has been output or is to be output.
Embodiments of the present application also provide a computer readable storage medium storing a computer program which, when executed by a processor, implements steps that may implement the various method embodiments described above.
The present embodiments provide a computer program product which, when run on a terminal device, causes the terminal device to perform steps that enable the respective method embodiments described above to be implemented.
Based on such understanding, the present application implements all or part of the flow of the method of the above embodiments, and may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, where the computer program, when executed by a processor, may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a terminal device, a recording medium, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Such as a U-disk, removable hard disk, magnetic or optical disk, etc. In some jurisdictions, computer readable media may not be electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions 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 solution. 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.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other manners. For example, the apparatus/network device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions in actual implementation, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting; 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 scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (10)

1. A method of dragging an object across applications, comprising:
when a cross-application drag event is detected, converting object data of a dragged object into serialized data by a first application program, and writing the serialized data into a shared memory;
and after the writing of the serialized data is completed, the second application program reads the serialized data from the shared memory, and performs deserialization operation according to the serialized data, so as to create an object instance in the second application program.
2. The cross-application object dragging method as claimed in claim 1, wherein before the first application program converts object data of the dragged object into serialized data, further comprising:
judging whether the dragged object is an integrity object or not;
if the dragged object is an integrity object, converting object data of the dragged object into serialized data; otherwise, feedback the invalid drag information.
3. The cross-application object dragging method as claimed in claim 1, wherein the first application program converting object data of the dragged object into serialized data and writing the serialized data into the shared memory when the cross-application dragging event is detected, comprising:
when a cross-application drag event is detected, when a drag mark position is idle, a first application program takes the drag mark position as the drag position;
the writing completion identification position is the incomplete writing;
carrying out serialization conversion on the object data of the dragged object to obtain serialized data;
and allocating a first buffer area for the serialized data from the shared memory, writing the serialized data into the first buffer area, and taking the writing completion identification position as the completion writing after the writing is completed.
4. The method for dragging an object across applications according to claim 3, wherein said allocating a first buffer for said serialized data from said shared memory, writing said serialized data into said first buffer, and after completing writing, said writing completion identification location is after completing writing, further comprises:
and calculating a check code according to the serialized data, and writing the check code into a check area.
5. The method for dragging an object across applications according to claim 3, wherein after writing of the serialized data is completed, a second application program reads the serialized data from the shared memory, and performs an anti-serialization operation according to the serialized data, and creating an object instance in the second application program includes:
the second application program accesses the drag identification bit and the writing completion identification bit;
if the dragging identification bit is in dragging, and the writing completion identification bit is writing completion, the dragging identification bit is occupied, and a second cache area is created in the exclusive process memory of the second application degree according to the data quantity of the serialization information;
reading the serialized data from the first cache region, writing the read serialized data into the second cache region, and after writing is completed, setting the dragging identification position as idle;
and performing deserialization operation according to the serialized data in the second buffer area to obtain an object instance.
6. The method for dragging an object across applications according to claim 5, wherein the steps of reading the serialized data from the first buffer area, writing the read serialized data into the second buffer area, and after writing, determining that the dragging mark position is idle, further comprise:
and reading a check code and checking the serialized data.
7. The method for dragging an object across applications according to any one of claims 1 to 6, wherein after the writing of the serialized data is completed, a second application program reads the serialized data from the shared memory and performs a deserialization operation according to the serialized data, and after creating an object instance in the second application program, the method further comprises:
and releasing the shared memory.
8. An object dragging device across applications, comprising:
the conversion module is used for converting object data of a dragged object into serialized data by the first application program when a cross-application dragging event is detected, and writing the serialized data into the shared memory;
and the creation module is used for reading the serialized data from the shared memory by the second application program after the serialized data is written, performing deserialization operation according to the serialized data and creating an object instance in the second application program.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 7 when executing the computer program.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the method according to any one of claims 1 to 7.
CN202211714706.5A 2022-12-29 2022-12-29 Cross-application object dragging method and device, terminal equipment and storage medium Pending CN116225409A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211714706.5A CN116225409A (en) 2022-12-29 2022-12-29 Cross-application object dragging method and device, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211714706.5A CN116225409A (en) 2022-12-29 2022-12-29 Cross-application object dragging method and device, terminal equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116225409A true CN116225409A (en) 2023-06-06

Family

ID=86568814

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211714706.5A Pending CN116225409A (en) 2022-12-29 2022-12-29 Cross-application object dragging method and device, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116225409A (en)

Similar Documents

Publication Publication Date Title
WO2019153544A1 (en) Annotation backend check method and apparatus, computer device and storage medium.
US20170357831A1 (en) Hardware assist for privilege access violation checks
JP6984710B2 (en) Computer equipment and memory management method
CN112445729B (en) Operation address determination method, PCIe system, electronic device and storage medium
CN104866443A (en) Interruptible store exclusive
CN112506569B (en) Byte code executing method, byte code executing device and terminal equipment
CN110825435B (en) Method and apparatus for processing data
US20100161914A1 (en) Autonomous memory subsystems in computing platforms
CN112631657A (en) Byte comparison method and instruction processing device for character string processing
CN113849238A (en) Data communication method, device, electronic equipment and readable storage medium
CN111258950B (en) Atomic access and storage method, storage medium, computer equipment, device and system
US9898301B2 (en) Framework to provide time bound execution of co-processor commands
CN116225409A (en) Cross-application object dragging method and device, terminal equipment and storage medium
US20110200059A1 (en) BIT Inversion For Communication Interface
CN108733479B (en) Method for unloading solid state hard disk card and device using same
CN112764729B (en) Application software development method, device, computer equipment and readable storage medium
CN115269199A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN114297119A (en) Intelligent contract execution method, device, equipment and storage medium
CN116991593B (en) Operation instruction processing method, device, equipment and storage medium
CN111885152B (en) Promotion information processing method, electronic device and computer-readable storage medium
CN114579189B (en) Single-core and multi-core register data access method, processor and system
CN112579207B (en) Data loading method, device and equipment
CN114896179B (en) Memory page copying method and device, computing equipment and readable storage medium
CN115297169B (en) Data processing method, device, electronic equipment and medium
CN117455750B (en) Video memory management method, device, system, medium and 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