Picture sharing method and device
Through the cooperation of the plug-in of the cross-platform application development framework and the cache mapping manager, image cache sharing between Flutter and the native platform is realized, solving the problems of low image loading efficiency and development complexity, and improving application performance and user experience. .
Patent Information
- Application Number
- CN202410612968.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-16
- Publication Date
- 2024-08-20
AI Technical Summary
When developing mobile applications, there is a lack of unified management of image cache between Flutter and the native platform, resulting in low image loading efficiency and increased development complexity, especially when the network environment is poor and the user experience is poor.
Query the cache mapping manager through the plug-in of the cross-platform application development framework, determine whether the image is stored in the cache, and obtain or download the image in the cache, so as to realize the sharing of cached images between the cross-platform application development framework and the native platform and reduce repeated downloads. Improve loading speed and development efficiency.
It reduces repeated downloads of network images, speeds up image loading, improves application performance and user experience, and reduces development workload. Especially in poor network environments, users can see image content faster.
Smart Images

Figure CN118519699A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and specifically to the field of software development technology. Background Art
[0002] With the popularity of smart phones and the development of mobile Internet technology, mobile applications (Application, App) have become an indispensable part of people's daily life. In the process of mobile application development, Flutter, as an open source UI (User Interface) software development toolkit, has been widely used and recognized due to its cross-platform and high-performance features.
[0003] However, the development work of Flutter and the development work of native platforms (such as iOS, Android, PC, Mac, etc.) are usually not done by the same developer. When developing applications using native platforms, it is often necessary to load, download, cache, and display network images. When developing the same application using Flutter, it is also necessary to load, download, cache, and display network images. Currently, when developing native platform applications or Flutter applications that involve image loading, developers often need to implement image caching processing on both platforms separately. Summary of the invention
[0004] The embodiments of the present disclosure provide a picture sharing method, apparatus, device, storage medium, and program product.
[0005] In a first aspect, an embodiment of the present disclosure proposes a picture sharing method, including: receiving a first picture loading request sent by a cross-platform application development framework; querying a cache mapping manager through a plug-in of the cross-platform application development framework to determine whether a first picture corresponding to the first picture loading request is stored in the cache; in response to determining that the first picture is stored in the cache, obtaining the first picture from the cache and sending it to the cross-platform application development framework.
[0006] In the second aspect, an embodiment of the present disclosure proposes a picture sharing device, including: a first receiving module, configured to receive a first picture loading request sent by a cross-platform application development framework; a first query module, configured to query a cache mapping manager through a plug-in of the cross-platform application development framework to determine whether the first picture corresponding to the first picture loading request is stored in the cache; a first acquisition module, configured to obtain the first picture from the cache in response to determining that the first picture is stored in the cache, and send it to the cross-platform application development framework.
[0007] In a third aspect, an embodiment of the present disclosure proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in the first aspect.
[0008] In a fourth aspect, an embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, where the computer instructions are used to cause a computer to execute the method described in the first aspect.
[0009] In a fifth aspect, an embodiment of the present disclosure proposes a computer program product, including a computer program, which implements the method described in the first aspect when executed by a processor.
[0010] The disclosed embodiment provides a method for sharing pictures, which realizes the sharing of cached pictures between a cross-platform application development framework and a native platform, and is suitable for scenarios where network pictures need to be efficiently loaded and displayed in a cross-platform application development framework. The method has the following technical effects:
[0011] 1. Reduce the repeated downloading of network pictures, speed up the loading of pictures, and improve the performance of the application.
[0012] 2. Reduced development workload and improved development efficiency.
[0013] 3. Improved user experience, especially in poor network conditions, users can see image content faster.
[0014] The key or important features of the embodiments of the present disclosure are not intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Other features, purposes and advantages of the present disclosure will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings. The drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure. Among them:
[0016] Figure 1 is a flow chart of an embodiment of a picture sharing method according to the present disclosure;
[0017] Figure 2 is a flow chart of another embodiment of the picture sharing method according to the present disclosure;
[0018] Figure 3 is a flow chart of another embodiment of the picture sharing method according to the present disclosure;
[0019] Figure 4is a timing diagram that can implement the picture sharing method of the embodiment of the present disclosure;
[0020] Figure 5 is a structural schematic diagram of an embodiment of a picture sharing device according to the present disclosure;
[0021] Figure 6 It is a block diagram of an electronic device used to implement the picture sharing method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0022] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0023] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0024] Figure 1 A process 100 of an embodiment of a picture sharing method according to the present disclosure is shown. The picture sharing method comprises the following steps:
[0025] Step 101: Receive a first image loading request sent by a cross-platform application development framework.
[0026] In this embodiment, when the cross-platform application development framework is used to develop an application, the cross-platform application development framework may send a first image loading request.
[0027] Among them, the cross-platform application development framework can support cross-platform application development. Flutter is a common cross-platform application development framework. Flutter is an open source UI software development toolkit that helps developers efficiently build multi-platform applications through a set of code libraries, supporting mobile, Web (World Wide Web), desktop and embedded platforms. The first image loading request may include a first image name or a first image identifier, which is used to uniquely identify the requested first image.
[0028] Step 102: query the cache mapping manager through the plug-in of the cross-platform application development framework to determine whether the first image corresponding to the first image loading request is stored in the cache.
[0029] In this embodiment, the cache mapping manager can be queried through a plug-in of a cross-platform application development framework to determine whether the first image corresponding to the first image loading request is stored in the cache.
[0030] Typically, the cache mapping manager stores the name or identifier of the image in the cache. The plug-in of the cross-platform application development framework can match the first image name or the first image identifier in the cache mapping manager. If the match is successful, it is determined that the first image is stored in the cache; if the match fails, it is determined that the first image is not stored in the cache.
[0031] Among them, the plug-in of the cross-platform application development framework can bridge the cross-platform application development framework and the native platform. Through the plug-in of the cross-platform application development framework, the API (Application Programming Interface) of the native platform can be called to realize the loading and caching of pictures. In the plug-in of the cross-platform application development framework, a cache mapping manager can be implemented to store the name or identifier of the picture in the cache. The cache can be a common memory of the cross-platform application development framework and the native platform. The pictures downloaded by the cross-platform application development framework and the native platform can be stored in the cache.
[0032] In some embodiments, the plug-in of the cross-platform application development framework is created after the hybrid project of the cross-platform application development framework and the native platform is created.
[0033] Among them, the steps for creating a hybrid project can be as follows:
[0034] The first step is to establish the dependency relationship between the library files released by the cross-platform application development framework and the projects of the native platform.
[0035] The second step is to create a two-way message channel between the cross-platform application development framework and the native platform.
[0036] The third step is to create a two-way page launch channel between the cross-platform application development framework and the native platform.
[0037] The fourth step is to encapsulate the messages that define the cross-platform application development framework in the native platform.
[0038] The fifth step is to define native platform messages in the cross-platform application development framework.
[0039] By creating a hybrid project of the cross-platform application development framework and the native platform, some pages of the cross-platform application development framework can be integrated into the native platform. It is suitable for iterating old applications developed on the native platform without affecting the original functions. New functions are developed using the cross-platform application development framework.
[0040] Step 103 , in response to determining that the first image is stored in the cache, obtaining the first image from the cache and sending it to the cross-platform application development framework.
[0041] In this embodiment, when the first image is stored in the cache, the first image can be obtained from the cache and sent to the cross-platform application development framework.
[0042] In some embodiments, when the first image is not stored in the cache, the first image is downloaded through the cross-platform application development framework, and the first image is stored in the cache, and the first image is sent to the cross-platform application development framework.
[0043] The disclosed embodiment provides a method for sharing pictures, which realizes the sharing of cached pictures between a cross-platform application development framework and a native platform, and is suitable for scenarios where network pictures need to be efficiently loaded and displayed in a cross-platform application development framework. The method has the following technical effects:
[0044] 1. Reduce the repeated downloading of network pictures, speed up the loading of pictures, and improve the performance of the application.
[0045] 2. Reduced development workload and improved development efficiency.
[0046] 3. Improved user experience, especially in poor network conditions, users can see image content faster.
[0047] Continue to refer Figure 2 , which shows a process 200 of another embodiment of the picture sharing method according to the present disclosure. The picture sharing method includes the following steps:
[0048] Step 201: receiving a first image loading request sent by a cross-platform application development framework.
[0049] In this embodiment, when the cross-platform application development framework is used to develop an application, the cross-platform application development framework may send a first image loading request.
[0050] Among them, the cross-platform application development framework can support cross-platform application development. Flutter is a common cross-platform application development framework. Flutter is an open source UI software development toolkit that helps developers efficiently build multi-platform applications through a set of code libraries, supporting mobile, web, desktop and embedded platforms. The first image loading request may include a first image name, which is used to uniquely identify the requested first image.
[0051] Step 202: query the cache mapping manager through the plug-in of the cross-platform application development framework to determine whether the cache mapping manager stores the first picture name.
[0052] In this embodiment, through the plug-in of the cross-platform application development framework, the cache mapping manager can be queried to determine whether the first image corresponding to the first image loading request is stored in the cache. If the name of the first image is stored in the cache mapping manager, step 203 is executed; if the name of the first image is not stored in the cache mapping manager, step 205 is executed.
[0053] Typically, the cache mapping manager stores the name and identification string of the image in the cache. The plug-in of the cross-platform application development framework can match the first image name in the cache mapping manager. If the match is successful, it is determined that the first image name is stored in the cache mapping manager; if the match fails, it is determined that the first image name is not stored in the cache mapping manager.
[0054] Among them, the plug-in of the cross-platform application development framework can bridge the cross-platform application development framework and the native platform. Through the plug-in of the cross-platform application development framework, the API of the native platform can be called to realize the loading and caching of pictures. In the plug-in of the cross-platform application development framework, a cache mapping manager can be implemented to maintain the mapping relationship between the name of the picture in the cache and the identification string. The cache can be the common memory of the cross-platform application development framework and the native platform. The pictures downloaded by the cross-platform application development framework and the native platform can be stored in the cache. The identification string of the picture can be used to uniquely identify the picture, which is a string of fixed length (such as 16 bits, 32 bits, etc.).
[0055] Step 203: Obtain a first identification string corresponding to the first picture name from the cache mapping manager.
[0056] In this embodiment, when the first picture name is stored in the cache mapping manager, the first identification character string corresponding to the first picture name can be obtained from the cache mapping manager.
[0057] Step 204 , obtaining a first image corresponding to the first identification string from the cache, and sending the first image to the cross-platform application development framework.
[0058] In this embodiment, a first image corresponding to the first identification string is obtained from the cache, and the first image is sent to the cross-platform application development framework.
[0059] Step 205 , determining that the first image is not stored in the cache, and downloading the first image through a cross-platform application development framework.
[0060] In this embodiment, when the name of the first picture is not stored in the cache mapping manager, it is determined that the first picture is not stored in the cache, and the first picture can be downloaded through the cross-platform application development framework.
[0061] Step 206: store the first identification string and the first image in a corresponding manner in a cache, and send them to a cross-platform application development framework.
[0062] In this embodiment, the first identification string and the first image are stored in a cache in correspondence, and the first image is sent to a cross-platform application development framework.
[0063] Step 207: Store the first picture name and the first identification string in a corresponding manner in a cache mapping manager.
[0064] In this embodiment, the first picture name and the first identification string are stored in the cache mapping manager in correspondence, thereby achieving synchronous update of the cache mapping manager.
[0065] The disclosed embodiment provides a method for sharing pictures, which realizes the sharing of cached pictures between a cross-platform application development framework and a native platform, and is suitable for scenarios where network pictures need to be efficiently loaded and displayed in a cross-platform application development framework. The method has the following technical effects:
[0066] 1. Reduce the repeated downloading of network pictures, speed up the loading of pictures, and improve the performance of the application.
[0067] 2. Reduced development workload and improved development efficiency.
[0068] 3. Improved user experience, especially in poor network conditions, users can see image content faster.
[0069] Further references Figure 3 , which shows a process 300 of another embodiment of a picture sharing method according to the present disclosure. The picture sharing method comprises the following steps:
[0070] Step 301: Receive a first image loading request sent by a cross-platform application development framework.
[0071] In this embodiment, when the cross-platform application development framework is used to develop an application, the cross-platform application development framework may send a first image loading request.
[0072] Among them, the cross-platform application development framework can support cross-platform application development. Flutter is a common cross-platform application development framework. Flutter is an open source UI software development toolkit that helps developers efficiently build multi-platform applications through a set of code libraries, supporting mobile, web, desktop and embedded platforms. The first image loading request may include a first image name or a first image identifier, which is used to uniquely identify the requested first image.
[0073] Step 302: query the cache mapping manager through the plug-in of the cross-platform application development framework to determine whether the first image corresponding to the first image loading request is stored in the cache.
[0074] In this embodiment, through the plug-in of the cross-platform application development framework, the cache mapping manager can be queried to determine whether the first image corresponding to the first image loading request is stored in the cache. If the first image is stored in the cache, step 303 is executed; if the first image is not stored in the cache, step 304 is executed.
[0075] Typically, the cache mapping manager stores the name or identifier of the image in the cache. The plug-in of the cross-platform application development framework can match the first image name or the first image identifier in the cache mapping manager. If the match is successful, it is determined that the first image is stored in the cache; if the match fails, it is determined that the first image is not stored in the cache.
[0076] Among them, the plug-in of the cross-platform application development framework can bridge the cross-platform application development framework and the native platform. Through the plug-in of the cross-platform application development framework, the API of the native platform can be called to realize the loading and caching of pictures. In the plug-in of the cross-platform application development framework, a cache mapping manager can be implemented to store the name or identifier of the picture in the cache. The cache can be a common memory of the cross-platform application development framework and the native platform. The pictures downloaded by the cross-platform application development framework and the native platform can be stored in the cache.
[0077] Step 303, obtaining the first image from the cache and sending it to the cross-platform application development framework.
[0078] In this embodiment, when the first image is stored in the cache, the first image can be obtained from the cache and sent to the cross-platform application development framework.
[0079] Step 304: download the first image through a cross-platform application development framework.
[0080] In this embodiment, when the first image is not stored in the cache, the first image is downloaded through the cross-platform application development framework.
[0081] Step 305: store the first image in a cache and send it to a cross-platform application development framework.
[0082] In this embodiment, the first image is stored in the cache and sent to the cross-platform application development framework.
[0083] Step 306: Receive a second image loading request sent by the native platform.
[0084] In this embodiment, when a native platform is used to develop an application, the native platform may send a second image loading request.
[0085] The native platform may be, for example, iOS, Android, PC, Mac, etc. The second image loading request may include a second image name or a second image identifier, which is used to uniquely identify the requested second image.
[0086] Step 307: query the cache mapping manager to determine whether the second image corresponding to the second image loading request is stored in the cache.
[0087] In this embodiment, the cache mapping manager is queried to determine whether the cache stores the second image corresponding to the second image loading request. If the cache stores the second image, step 308 is executed; if the cache does not store the second image, step 309 is executed.
[0088] Step 308: Get the second image from the cache and send it to the native platform.
[0089] In this embodiment, when the second image is stored in the cache, the second image can be obtained from the cache and sent to the native platform.
[0090] Step 309: download the second image through the native platform.
[0091] In this embodiment, when the second image is not stored in the cache, the second image can be downloaded through the native platform.
[0092] Step 310: store the second image in the cache and send it to the native platform.
[0093] In this embodiment, the second image is stored in the cache and sent to the native platform at the same time.
[0094] In some embodiments, the second image loading request may include the name of the second image. At this time, the cache mapping manager is queried to determine whether the second image name is stored in the cache mapping manager; if the cache mapping manager stores the second image name, the second identification string corresponding to the second image name may be obtained from the cache mapping manager, and the second image corresponding to the second identification string may be obtained from the cache. If the second image name is not stored in the cache mapping manager, it may be determined that the second image is not stored in the cache. At this time, the second image may be downloaded through the cross-platform application development framework; the second identification string and the second image may be stored in the cache; and the second image name and the second identification string may be stored in the cache mapping manager.
[0095] The disclosed embodiment provides a method for sharing pictures, which realizes the sharing of cached pictures between a cross-platform application development framework and a native platform, and is suitable for scenarios where network pictures need to be efficiently loaded and displayed in a cross-platform application development framework. The method has the following technical effects:
[0096] 1. Reduce the repeated downloading of network pictures, speed up the loading of pictures, and improve the performance of the application.
[0097] 2. Reduced development workload and improved development efficiency.
[0098] 3. Improved user experience, especially in poor network conditions, users can see image content faster.
[0099] For ease of understanding, Figure 4 A timing diagram is shown that can implement the picture sharing method of the embodiment of the present disclosure.
[0100] like Figure 4 As shown, the steps of the picture sharing method are as follows:
[0101] Step 401, obtain the image from the Flutter cache from the Flutter image view.
[0102] Step 402, obtain the image from the Flutter cache to the shared memory.
[0103] Step 403, Flutter downloads the picture.
[0104] Step 404, save the image to the common memory.
[0105] Step 405: Return the image from the shared memory to the Flutter cache.
[0106] Step 406, returning the image from the Flutter cache to the Flutter image view.
[0107] Further references Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a picture sharing device. Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0108] like Figure 5 As shown, the picture sharing device 500 of this embodiment may include: a first receiving module 501, a first query module 502 and a first acquisition module 503. The first receiving module 501 is configured to receive a first picture loading request sent by a cross-platform application development framework; the first query module 502 is configured to query a cache mapping manager through a plug-in of the cross-platform application development framework to determine whether the first picture corresponding to the first picture loading request is stored in the cache; the first acquisition module 503 is configured to obtain the first picture from the cache in response to determining that the first picture is stored in the cache, and send it to the cross-platform application development framework.
[0109] In this embodiment, in the picture sharing device 500, the specific processing of the first receiving module 501, the first query module 502 and the first obtaining module 503 and the technical effects thereof can be referred to in Figure 1 The relevant descriptions of steps 101 - 103 in the corresponding embodiment are not repeated here.
[0110] In some optional implementations of this embodiment, a plug-in of a cross-platform application development framework bridges the cross-platform application development framework and the native platform.
[0111] In some optional implementations of this embodiment, the plug-in of the cross-platform application development framework is created after the hybrid project of the cross-platform application development framework and the native platform is created.
[0112] In some optional implementations of this embodiment, a hybrid project is created through the following steps: establishing a dependency relationship between the library files published by the cross-platform application development framework and the projects of the native platform; creating a two-way message channel between the cross-platform application development framework and the native platform; creating a two-way page launch channel between the cross-platform application development framework and the native platform; encapsulating messages defining the cross-platform application development framework in the native platform; and defining messages of the native platform in the cross-platform application development framework.
[0113] In some optional implementations of this embodiment, the first image loading request includes a first image name; and the first query module 502 is further configured to: query the cache mapping manager through a plug-in of a cross-platform application development framework to determine whether the first image name is stored in the cache mapping manager; and the first acquisition module 503 is further configured to: in response to the first image name being stored in the cache mapping manager, obtain a first identification string corresponding to the first image name from the cache mapping manager; and obtain the first image corresponding to the first identification string from the cache.
[0114] In some optional implementations of this embodiment, the picture sharing device 500 also includes: a first downloading module, configured to download the first picture through a cross-platform application development framework in response to determining that the first picture is not stored in the cache; a first storage module, configured to store the first picture in the cache and send it to the cross-platform application development framework.
[0115] In some optional implementations of this embodiment, the first download module is further configured to: in response to the first picture name not being stored in the cache mapping manager, determine that the first picture is not stored in the cache, and download the first picture through a cross-platform application development framework; and the first storage module is further configured to: store the first identification string and the first picture in the cache in correspondence; store the first picture name and the first identification string in the cache mapping manager in correspondence.
[0116] In some optional implementations of the present embodiment, the picture sharing device 500 also includes: a second receiving module, configured to receive a second picture loading request sent by the native platform; a second query module, configured to query the cache mapping manager to determine whether the second picture corresponding to the second picture loading request is stored in the cache; a second acquisition module, configured to obtain the second picture from the cache in response to determining that the second picture is stored in the cache, and send it to the native platform.
[0117] In some optional implementations of this embodiment, the second image loading request includes a second image name; and the second query module is further configured to: query the cache mapping manager to determine whether the second image name is stored in the cache mapping manager; and the second acquisition module is further configured to: in response to the second image name being stored in the cache mapping manager, obtain a second identification string corresponding to the second image name from the cache mapping manager; and obtain a second image corresponding to the second identification string from the cache.
[0118] In some optional implementations of this embodiment, the picture sharing device 500 also includes: a second download module, configured to download the second picture through the native platform in response to determining that the second picture is not stored in the cache; a second storage module, configured to store the second picture in the cache and send it to the native platform.
[0119] In some optional implementations of this embodiment, the second download module is further configured to: in response to the second picture name not being stored in the cache mapping manager, determine that the second picture is not stored in the cache, and download the second picture through a cross-platform application development framework; and the second storage module is further configured to: store the second identification string and the second picture correspondingly in the cache; store the second picture name and the second identification string correspondingly in the cache mapping manager.
[0120] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0121] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0122] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0123] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0124] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0125] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as the picture sharing method. For example, in some embodiments, the picture sharing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the picture sharing method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the picture sharing method in any other appropriate manner (e.g., by means of firmware).
[0126] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0127] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0128] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0129] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0130] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0131] A computer system may include clients and servers. The client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises through computer programs running on respective computers and having a client-server relationship to each other. The server may be a cloud server, a server in a distributed system, or a server in combination with a blockchain.
[0132] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions provided by this disclosure can be achieved, and this document does not limit this.
[0133] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for sharing a picture, comprising: receiving a first image loading request sent by a cross-platform application development framework; querying a cache mapping manager through a plug-in of a cross-platform application development framework to determine whether a first image corresponding to the first image loading request is stored in the cache; In response to determining that the first image is stored in the cache, the first image is obtained from the cache and sent to the cross-platform application development framework.
2. The method according to claim 1, wherein: The plug-in of the cross-platform application development framework bridges the cross-platform application development framework and the native platform.
3. The method according to claim 2, wherein: The plug-in of the cross-platform application development framework is created after the hybrid project of the cross-platform application development framework and the native platform is created.
4. The method according to claim 3, wherein: The hybrid project is created by the following steps: Establishing a dependency relationship between the library files published by the cross-platform application development framework and the project of the native platform; Creating a bidirectional message channel between the cross-platform application development framework and the native platform; Creating a two-way page launch channel between the cross-platform application development framework and the native platform; Encapsulating a message defining the cross-platform application development framework in the native platform; Messages of the native platform are defined in the cross-platform application development framework.
5. The method according to claim 1, wherein: The first picture loading request includes a first picture name; as well as The querying of the cache mapping manager through the plug-in of the cross-platform application development framework to determine whether the first image corresponding to the first image loading request is stored in the cache includes: querying the cache mapping manager through the plug-in of the cross-platform application development framework to determine whether the first picture name is stored in the cache mapping manager; and In response to determining that the first picture is stored in the cache, obtaining the first picture from the cache includes: In response to the first picture name being stored in the cache mapping manager, obtaining a first identification string corresponding to the first picture name from the cache mapping manager; A first picture corresponding to the first identification string is obtained from the cache.
6. The method according to claim 5, wherein: The method further comprises: In response to determining that the first image is not stored in the cache, downloading the first image through the cross-platform application development framework; The first image is stored in the cache and sent to the cross-platform application development framework.
7. The method according to claim 6, wherein: In response to determining that the first image is not stored in the cache, downloading the first image through the cross-platform application development framework includes: In response to the first picture name not being stored in the cache mapping manager, determining that the first picture is not stored in the cache, and downloading the first picture through the cross-platform application development framework; and The storing the first picture in the cache includes: storing the first identification string and the first image in the cache in correspondence; The first picture name and the first identification string are stored correspondingly in the cache mapping manager.
8. The method according to claim 1, wherein: The method further comprises: Receive a second image loading request sent by the native platform; querying the cache mapping manager to determine whether the second image corresponding to the second image loading request is stored in the cache; In response to determining that the second image is stored in the cache, the second image is obtained from the cache and sent to the native platform.
9. The method according to claim 8, wherein: The second picture loading request includes a second picture name; as well as The querying the cache mapping manager to determine whether the cache stores the second image corresponding to the second image loading request, includes: querying the cache mapping manager to determine whether the second picture name is stored in the cache mapping manager; and In response to determining that the second picture is stored in the cache, obtaining the second picture from the cache includes: In response to the second picture name being stored in the cache mapping manager, obtaining a second identification string corresponding to the second picture name from the cache mapping manager; A second image corresponding to the second identification string is obtained from the cache.
10. The method according to claim 9, wherein: The method further comprises: In response to determining that the second image is not stored in the cache, downloading the second image through the native platform; The second image is stored in the cache and sent to the native platform.
11. The method according to claim 10, wherein: In response to determining that the second image is not stored in the cache, downloading the second image through the native platform includes: In response to the second picture name not being stored in the cache mapping manager, determining that the second picture is not stored in the cache, and downloading the second picture through the cross-platform application development framework; and The storing the second image in the cache includes: storing the second identification string and the second image in the cache in correspondence; The second picture name and the second identification string are stored in the cache mapping manager in correspondence.
12. A picture sharing device, comprising: A first receiving module is configured to receive a first image loading request sent by a cross-platform application development framework; A first query module is configured to query a cache mapping manager through a plug-in of a cross-platform application development framework to determine whether a first image corresponding to the first image loading request is stored in the cache; The first acquisition module is configured to, in response to determining that the first image is stored in the cache, acquire the first image from the cache and send the first image to the cross-platform application development framework.
13. The device according to claim 12, wherein: The plug-in of the cross-platform application development framework bridges the cross-platform application development framework and the native platform.
14. The device according to claim 13, wherein: The plug-in of the cross-platform application development framework is created after the hybrid project of the cross-platform application development framework and the native platform is created.
15. The device according to claim 14, wherein: The hybrid project is created by the following steps: Establishing a dependency relationship between the library files published by the cross-platform application development framework and the project of the native platform; Creating a bidirectional message channel between the cross-platform application development framework and the native platform; Creating a two-way page launch channel between the cross-platform application development framework and the native platform; Encapsulating a message defining the cross-platform application development framework in the native platform; Messages of the native platform are defined in the cross-platform application development framework.
16. The device according to claim 12, wherein: The first picture loading request includes a first picture name; and The first query module is further configured to: querying the cache mapping manager through the plug-in of the cross-platform application development framework to determine whether the first picture name is stored in the cache mapping manager; and The first acquisition module is further configured to: In response to the first picture name being stored in the cache mapping manager, obtaining a first identification string corresponding to the first picture name from the cache mapping manager; A first picture corresponding to the first identification string is obtained from the cache.
17. The device according to claim 16, wherein: The device also includes: a first downloading module, configured to download the first image through the cross-platform application development framework in response to determining that the first image is not stored in the cache; The first storage module is configured to store the first image in the cache and send it to the cross-platform application development framework.
18. The device according to claim 17, wherein: The first download module is further configured to: In response to the first picture name not being stored in the cache mapping manager, determining that the first picture is not stored in the cache, and downloading the first picture through the cross-platform application development framework; and The first storage module is further configured to: storing the first identification string and the first image in the cache in correspondence; The first picture name and the first identification string are stored correspondingly in the cache mapping manager.
19. The device according to claim 12, wherein: The device also includes: A second receiving module is configured to receive a second image loading request sent by the native platform; a second query module, configured to query the cache mapping manager to determine whether the second image corresponding to the second image loading request is stored in the cache; The second acquisition module is configured to, in response to determining that the second image is stored in the cache, acquire the second image from the cache and send it to the native platform.
20. The device according to claim 19, wherein The second picture loading request includes a second picture name; and The second query module is further configured to: querying the cache mapping manager to determine whether the second picture name is stored in the cache mapping manager; and The second acquisition module is further configured to: In response to the second picture name being stored in the cache mapping manager, obtaining a second identification string corresponding to the second picture name from the cache mapping manager; A second image corresponding to the second identification string is obtained from the cache.
21. The device according to claim 20, wherein: The device also includes: a second downloading module, configured to, in response to determining that the second image is not stored in the cache, download the second image through the native platform; The second storage module is configured to store the second image in the cache and send it to the native platform.
22. The device according to claim 21, wherein The second download module is further configured to: In response to the second picture name not being stored in the cache mapping manager, determining that the second picture is not stored in the cache, and downloading the second picture through the cross-platform application development framework; and The second storage module is further configured to: storing the second identification string and the second image in the cache in correspondence; The second picture name and the second identification string are stored in the cache mapping manager in correspondence.
23. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 11.
24. A non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the method of any one of claims 1-11.
25. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Picture loading method and device
CN113449215A
Picture display method and device, computer readable storage medium and electronic equipment
CN113791777A
Flutter and native platform mixed development method, system and device
CN116795356A
Method and system for implementing a multi-platform framework for shared services
US10896078B1
