A method, apparatus and medium for sharing web pages
By identifying client types and converting configuration templates, templates suitable for different sharing tools are generated, solving the problem of low efficiency for operations personnel in configuring templates for different clients and improving work efficiency.
Patent Information
- Application Number
- CN202211689099.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-27
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2042-12-27
AI Technical Summary
In internet social media, operators need to configure different page sharing templates for different types of clients, resulting in low work efficiency.
By receiving page sharing requests from clients, identifying client types, and converting configuration templates according to type, sharing templates suitable for apps or mini-programs are generated, and these templates can be called using the corresponding sharing tools.
This reduced the workload for operations staff in configuring templates for different clients, thus improving work efficiency.
Smart Images

Figure CN116185530B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus and medium for sharing web pages. Background Technology
[0002] With the rapid development of mobile internet technology and the full coverage of 4G and 5G networks, there are more and more types of client applications. Internet social media has become an important platform for people to communicate and obtain information, and the number of users of Internet social media is also increasing. The types of client applications for the same social media (such as mini-programs and applications) are also becoming more and more diverse.
[0003] When users encounter content pages that interest them on social media (such as games, articles, music, etc.), they share them with other users. The recipients can directly access the shared content page through the shared link. However, for content creators' operations staff, configuring different sharing templates for different social media clients leads to lower work efficiency. Summary of the Invention
[0004] This application provides a page sharing method, apparatus, and medium, which can solve the problem of low efficiency for operators when configuring page sharing information in the prior art.
[0005] To achieve the above objectives, this application adopts the following technical solution:
[0006] Firstly, this application provides a page sharing method, which includes:
[0007] Receive page sharing requests sent by clients and obtain the client type based on the page sharing requests; the page sharing request requests page sharing information of at least one front-end page, and the client type includes: application (APP) type and mini-program type;
[0008] In response to the client type being APP, the preset configuration template is converted to obtain the first sharing template, and the APP sharing tool is used to call the first sharing template; the configuration template is a configuration template for page sharing information, used to indicate the page sharing information displayed on the client, and the first sharing template meets the template rules of the APP sharing tool;
[0009] In response to the client type being a mini-program, the configuration template is converted to obtain a second sharing template, and the mini-program sharing tool is used to call the second sharing template; the second sharing template meets the template rules of the mini-program sharing tool.
[0010] As one possible implementation of the first aspect of this application, the APP sharing tool is a JSSDK. Before calling the first sharing template using the APP sharing tool, the method further includes:
[0011] Check if the client has a built-in JSSDK. If not, load the JSSDK.
[0012] As one possible implementation of the first aspect of this application, the mini-program sharing tool is onShareAppMessage. Before calling the second sharing template using the mini-program sharing tool, the method further includes:
[0013] Use the postMessage tool to send the second sharing template to the client's webview container;
[0014] Receive the second sharing template using the receiving tool bindmessage.
[0015] As one possible implementation of the first aspect of this application, the client type is obtained based on the page sharing request, including:
[0016] The client type is obtained by matching the navigator.userAgent field included in the page sharing request using regular expressions.
[0017] Secondly, this application provides a page sharing device, the device comprising:
[0018] The communication unit is used to receive page sharing requests sent by the client and obtain the client type based on the page sharing request; the page sharing request requests page sharing information of at least one front-end page, and the client type includes: application (APP) type and mini-program type;
[0019] The processing unit is used to respond to the client type being APP type, convert the preset configuration template to obtain the first sharing template, and use the APP sharing tool to call the first sharing template; the configuration template is a configuration template for page sharing information, used to indicate the page sharing information to be displayed on the client, and the first sharing template meets the template rules of the APP sharing tool;
[0020] In response to the client type being a mini-program, the configuration template is converted to obtain a second sharing template, and the mini-program sharing tool is used to call the second sharing template; the second sharing template meets the template rules of the mini-program sharing tool.
[0021] As a possible implementation of the second aspect of this application, the APP sharing tool is a jssdk. Before calling the first sharing template using the APP sharing tool, the processing unit is further configured to:
[0022] Check if the client has a built-in JSSDK. If not, load the JSSDK.
[0023] As a possible implementation of the second aspect of this application, the mini-program sharing tool is onShareAppMessage. Before calling the second sharing template using the mini-program sharing tool, the processing unit is further configured to:
[0024] Use the postMessage tool to send the second sharing template to the client's webview container;
[0025] Receive the second sharing template using the receiving tool bindmessage.
[0026] As one possible implementation of the second aspect of this application, the client type is obtained based on the page sharing request, including:
[0027] The client type is obtained by matching the navigator.userAgent field included in the page sharing request using regular expressions.
[0028] Thirdly, this application provides a page sharing device, which includes: a processor and a communication interface; the communication interface and the processor are coupled, and the processor is used to run computer programs or instructions to implement the page sharing method as described in the first aspect and any possible implementation of the first aspect.
[0029] Fourthly, this application provides a computer-readable storage medium storing instructions that, when executed on a terminal, cause the terminal to perform the page sharing method as described in the first aspect and any possible implementation thereof.
[0030] Fifthly, embodiments of this application provide a computer program product containing instructions that, when run on a page sharing device, cause the page sharing device to perform the page sharing method as described in the first aspect and any possible implementation thereof.
[0031] In a sixth aspect, embodiments of this application provide a chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run computer programs or instructions to implement the page sharing method as described in the first aspect and any possible implementation thereof.
[0032] Specifically, the chip provided in this application embodiment also includes a memory for storing computer programs or instructions.
[0033] Implementing the technical solution provided in this application can bring at least the following beneficial effects:
[0034] The technical solution provided in this application distinguishes different client types and converts the configuration template based on the client type to a sharing template suitable for different sharing tools. This allows operators to configure only one general template when configuring page sharing information, thereby improving their work efficiency. Attached Figure Description
[0035] Figure 1 A schematic diagram illustrating an application scenario provided in an embodiment of this application;
[0036] Figure 2 A flowchart illustrating a page sharing method provided in an embodiment of this application;
[0037] Figure 3 A schematic diagram of the structure of a page sharing device provided in an embodiment of this application;
[0038] Figure 4 A schematic diagram of another page sharing device provided in an embodiment of this application;
[0039] Figure 5 A schematic diagram of a chip structure provided in an embodiment of this application;
[0040] Figure 6 A schematic diagram of a page sharing method provided in an embodiment of this application;
[0041] Figure 7 This is another schematic diagram of the page sharing method provided in the embodiments of this application. Detailed Implementation
[0042] The page sharing method and apparatus provided in the embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0043] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0044] The terms "first" and "second," etc., used in the specification and drawings of this application are used to distinguish different objects or to distinguish different treatments of the same object, rather than to describe a specific order of objects.
[0045] Furthermore, the terms "comprising" and "having," and any variations thereof, used in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.
[0046] It should be noted that in the embodiments of this application, the words "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0047] The following explains some of the related terms and technologies involved in the embodiments of this application.
[0048] First, some of the terms used in the embodiments of this application will be explained to facilitate understanding by those skilled in the art.
[0049] Terminal devices can be mobile terminals, fixed terminals, or portable terminals, such as mobile phones, sites, units, devices, multimedia computers, multimedia tablets, internet nodes, communicators, desktop computers, laptop computers, notebook computers, netbook computers, tablet computers, personal communication system devices, personal navigation devices, personal digital assistants, audio / video players, digital cameras / camcorders, positioning devices, television receivers, radio broadcast receivers, e-book devices, gaming devices, or any combination thereof, including accessories and peripherals of these devices, or any combination thereof. It is also foreseeable that terminal devices can support any type of user-facing interface (e.g., wearable devices).
[0050] Servers can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, and big data and artificial intelligence platforms.
[0051] Cloud storage is a new concept that has been extended and developed from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as a storage system) refers to a storage system that uses cluster applications, grid technology and distributed storage file systems to bring together a large number of storage devices of various types in the network (storage devices are also called storage nodes) to work together through application software or application interfaces to provide data storage and business access functions to the outside world.
[0052] Currently, the storage method in storage systems is as follows: Logical volumes are created. During logical volume creation, physical storage space is allocated to each logical volume. This physical storage space may consist of a single storage device or the disks of several storage devices. Applications store data on a logical volume, which means storing the data on the file system. The file system divides the data into many parts, each part being an object. Each object contains not only the data but also additional information such as data identifiers. The file system writes each object to the physical storage space of that logical volume, and it records the storage location information of each object. Therefore, when an application requests access to data, the file system can allow the application to access the data based on the storage location information of each object.
[0053] The process by which a storage system allocates physical storage space to a logical volume is as follows: the physical storage space is pre-divided into strips according to the capacity estimate of the objects stored in the logical volume (this estimate usually has a large margin relative to the actual capacity of the objects to be stored) and the grouping of Redundant Array of Independent Disks (RAID). A logical volume can be understood as a strip, thus allocating physical storage space to the logical volume.
[0054] Database: Simply put, it can be viewed as an electronic filing cabinet—a place to store electronic files, where users can perform operations such as adding, querying, updating, and deleting data. A "database" is a collection of data stored together in a certain way, capable of being shared by multiple users, with minimal redundancy, and independent of application programs.
[0055] Database Management Systems (DBMS) are computer software systems designed to manage databases, generally possessing basic functions such as storage, retrieval, security, and backup. DBMSs can be classified according to the database model they support, such as relational or Extensible Markup Language (XML); or the type of computer they support, such as server clusters or mobile devices; or the query language used, such as Structured Query Language (SQL) or XQuery; or performance priorities, such as maximum scale or highest operating speed; or other classification methods. Regardless of the classification method used, some DBMSs can cross categories, for example, supporting multiple query languages simultaneously.
[0056] Image template identification information: Used to indicate the page sharing image template that needs to be drawn.
[0057] The design concept of the embodiments of this application is described below.
[0058] With the rapid development of mobile internet technology and the full coverage of 4G and 5G networks, there are more and more types of client applications. Internet social media has become an important platform for people to communicate and obtain information, and the number of users of Internet social media is also increasing. The types of client applications for the same social media (such as mini-programs and applications) are also becoming more and more diverse.
[0059] When users encounter content pages that interest them on social media (such as games, articles, music, etc.), they share them with other users. The recipient can directly access the shared content page by clicking on the share information. However, for content creators, configuring different sharing templates for different social media clients reduces their efficiency and increases their workload.
[0060] The following is combined Figure 2 This application introduces the page sharing method provided.
[0061] like Figure 2 As shown, Figure 2 This is a schematic flowchart of a page sharing method provided in an embodiment of this application. As can be seen from the figure, the method includes:
[0062] S100. Receive a page sharing request sent by the client and obtain the client type based on the page sharing request; the page sharing request requests page sharing information of at least one front-end page, and the client type includes: application (APP) type and mini-program type;
[0063] As one possible implementation, embodiments of this application can use regular expressions to match the navigator.userAgent field included in the page sharing request to obtain the client type.
[0064] S200. In response to the client type being APP, the preset configuration template is converted to obtain the first sharing template;
[0065] S201. Use the APP sharing tool to call the first sharing template; configure the template as a configuration template for page sharing information, which is used to instruct the client to display page sharing information. The first sharing template meets the template rules of the APP sharing tool.
[0066] S300. In response to the client type being a mini-program, the configuration template is converted to obtain a second sharing template.
[0067] S301. Use the mini-program sharing tool to call the second sharing template; the second sharing template meets the template rules of the mini-program sharing tool.
[0068] With the page sharing method provided in this application embodiment, when configuring page sharing of user-shared content, operators only need to configure one template, without having to set separate templates for different manufacturers' clients or different types of clients. This can reduce the workload of operators and thus improve their work efficiency.
[0069] As one possible implementation of the first aspect of this application, the APP sharing tool can be a JSSDK, and before S201. calling the first sharing template using the APP sharing tool, the method further includes:
[0070] S200a. Determine if the client has a built-in JSSDK;
[0071] S200b. In response to the absence of a built-in jssdk, load the jssdk and execute S201 after the jssdk is loaded;
[0072] S200c. Responds to the built-in jssdk by directly executing S201.
[0073] As one possible implementation of the first aspect of this application, the mini-program sharing tool is onShareAppMessage. Before calling the second sharing template using the mini-program sharing tool, the method further includes:
[0074] S300a. Use the postMessage tool to transmit the second sharing template to the client's webview container;
[0075] The webview container within the S300b client receives the second sharing template via the bindmessage receiving tool.
[0076] As one possible implementation of the first aspect of this application, the client type is obtained based on the page sharing request, including:
[0077] The client type is obtained by matching the navigator.userAgent field included in the page sharing request using regular expressions.
[0078] In some application scenarios, users may share content they are interested in through more than one client.
[0079] For example, user A can share a front-end page that interests them with user B through the AA social software application, and at the same time, user A can also share a front-end page that interests them with user B through the BB social software mini-program.
[0080] In related technologies, the operators of this front-end page need to configure different sharing information for different applications and mini-programs. For example, they might configure unique sharing information for the AA social software application and its mini-program, and vice versa. This undoubtedly increases the workload and burden on the operators.
[0081] To further illustrate the technical solutions provided in the embodiments of this application, a detailed description is provided below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiments of this application provide method operation steps as shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on conventional or non-inventive effort. For steps that do not logically have a necessary causal relationship, the execution order of these steps is not limited to the execution order provided in the embodiments of this application. In actual processing or when the device executes the method, it may be executed sequentially or in parallel according to the method shown in the embodiments or drawings.
[0082] See Figure 1This figure illustrates an application scenario provided by this application. The scenario includes a control device 101 (only one shown in the figure) and multiple user devices 102a, 102b, and 102c (only three shown in the figure). The control device 101 is generally a backend server, but can also be a terminal device, a cloud server, a virtual machine deployed on a physical machine, etc. User device 102 can be a terminal device. The client can reside in the control device 101 and / or user device 102. The client can be an application or a small program running within an application.
[0083] For example, user A uses user device 102a, user B uses user device 102b, and user C uses user device 102c;
[0084] In some scenarios, user A uses user device 102a to share an AAA front-end page published by a content provider with user B through client A. User B's user device 102b needs to view the page sharing information of the AAA front-end page shared by user A through client A. The page sharing information of the AAA front-end page needs to be configured by the content provider's operations personnel. It can be used to indicate the elements and information to be displayed when the AAA front-end page is shared, including: front-end page summary, front-end page image, front-end page title, and the front-end page link that is redirected after being clicked, etc. At this time, the client of user device 102b will send a page sharing request to control device 101. This page sharing request at least requests the page sharing information of the AAA front-end page. Control device 101 can determine the client type of client A used by user device 102b based on the page sharing request and by parsing the client attribute fields included in the request. The client type can include: mini-program type and application (APP) type. The client attribute field can be the navigator.userAgent field. In some possible embodiments, this application embodiment can use regular expressions to match and determine the navigator.userAgent field and obtain the client type of client A.
[0085] If it is an APP type, the control device 101 will determine whether the client A of the user device 102b has the APP sharing tool jssdk; if it does not have the APP sharing tool, it will send a loading command to the user device 102b, and the user device 102b can load the APP sharing tool jssdk based on the loading command.
[0086] Simultaneously, control device 101 searches its data system for a configuration template matching the AAA front-end page and generates a first sharing template that meets the sharing requirements of the JSSDK sharing tool. After the JSSDK is loaded, it can display the page sharing information on client A of user device 102b based on the first sharing template. Therefore, the page sharing information of the AAA front-end page will be displayed on client A of user device 102b.
[0087] It is understood that the above configuration template defines the page sharing information that needs to be displayed on client A of user device 102b for the aforementioned AAA information, and can be pre-configured by the operator and stored in the storage system of control device 101. The configuration template and the first sharing template can be understood as two template files with different formats but the same substantive content. That is, the configuration template includes the configuration information required by the first sharing template. For example, if the content in the configuration template is "Title = Today's Weather", the content in the first sharing template may be "Title = Today's Weather" or "title = Today's Weather", both of which are used to define the title that needs to be displayed when the client displays the page sharing information.
[0088] Since clients from different vendors use different JSSDK versions, and different versions of clients use different JSSDK versions, as well as different field formats defined by the vendors, this application generates sharing templates in corresponding formats by configuring templates, which can improve the versatility of the technical solutions provided in the embodiments of this application.
[0089] In one possible implementation, the control device 101 searches its data system for a configuration template that matches the AAA front-end page and sends the configuration template to the user device 102b, which then generates a first sharing template that meets the sharing requirements of the jssdk sharing tool.
[0090] Specifically, such as Figure 6 As shown, Figure 6This is a schematic diagram of a page sharing method provided in the application embodiment. User A shares a front-end page 6000 that they are interested in with user B through an APP client. The front-end page 6000 has the title "Today's Weather," the summary "Sunny today, easy to travel," and its image is "Image 1," with content stating "Today's temperature, 15°C~20°C, light breeze...". Using the sharing method provided in this application, user B's user device 6001 can display the page sharing information. The title of this page sharing information is "Today's Weather," the summary is "Sunny today, easy to travel," and its image is "Image 1." This page information can also display a portion of the content from the front-end page 6000, such as "Today's temperature, 15°C~20°C...". Furthermore, if user B clicks on the page information on user device 6001, user device 6001 will redirect to the front-end page 6000 via a link, allowing user B to directly view the front-end page 6000 and access its content.
[0091] In some scenarios, user B uses user device 102b to share a content provider-published AAA front-end page with user C via client A. User C's user device 102c needs to view the page sharing information of the AAA front-end page shared by user A via client B. At this time, user device 102c will send a page sharing request to control device 101. This page sharing request at least requests the page sharing information of the AAA front-end page. Control device 101 can determine the client type of client B in user device 102c based on the page sharing request and by parsing the client attribute fields included in the request.
[0092] If it is a mini-program, the control device 101 will generate a second sharing template that meets the requirements of the sharing tool onShareAppMessage based on the configuration template, and transmit the second sharing template to the webview container inside the mini-program (client C) through the sending tool postMessage; the client C of the user device 102c can receive the second sharing template through the receiving tool bindmessage, and display the page sharing information on the interface of the client C through the sharing tool onShareAppMessage. It is understandable that because the mini-program is uniformly deployed and distributed by the mini-program manufacturer, all users of this mini-program use the same version number of the mini-program, and all configurations on the mini-program side are the same. Therefore, they can directly use the mini-program's built-in sharing tool for sharing.
[0093] It is understood that the aforementioned sending tool `postMessage` and receiving tool `bindMessage` can be understood as pre-encapsulated function classes or pre-defined command classes. For function-based tools, on the backend of the mini-program, the second sharing template can be sent by calling the `postMessage` function and placing it into the function; similarly, on the frontend of the mini-program, the second sharing template can be received by calling the `bindMessage` function and placing it into the function. For command-based tools, in this embodiment, the second sharing template can be sent to the mini-program's VebView container using the `postMessage` command on the backend corresponding to the mini-program's frontend, and simultaneously received using the `bindMessage` command on the frontend of the mini-program. It is understood that the aforementioned sending and receiving tools should exist in pairs and have a coupled nature; the mini-program backend needs to send files via `postMessage`, and the mini-program frontend needs to receive files via the `bindMessage` command.
[0094] It is understandable that the configuration template defines the page sharing information that needs to be displayed in client B of user device 102c. The configuration template and the second sharing template can be understood as two template files with different formats but the same substantive content. That is, the configuration template includes the configuration required by the second sharing template. For example, if the content in the configuration template is "Summary = Today is sunny, temperature 18 degrees", the content in the second sharing template may be "abstract = Today is sunny, temperature 18 degrees" or "abs = Today is sunny, temperature 18 degrees". Both are used to define the summary that needs to be displayed when the client displays the page sharing information.
[0095] Specifically, such as Figure 7 As shown, Figure 7This is another schematic diagram illustrating the page sharing method provided in the application embodiment. User B shares a front-end page 7000, which is of interest to user C, through a mini-program client. The front-end page 7000 has the title "Today's Weather," the summary "Sunny today, easy to travel," and its image is "Image 1," with content stating "Today's temperature, 15°C~20°C, light breeze…." Using the sharing method provided in this application, user C's user device 7001 can display the page sharing information. The title of this page sharing information is "Today's Weather," the summary is "Sunny today, easy to travel," and its image is "Image 1." Since the mini-program client does not support previewing the content of the front-end page 7000 in the shared information, there is no preview of the content of the front-end page 7000 in the shared information. Furthermore, if user C clicks on the page information on user device 7001, user device 7001 will redirect the page to the front-end page 7000 via a link, allowing user B to directly view the front-end page 7000 and access its content.
[0096] It should be noted that the content included in the first and second sharing templates may be the same or different. The content included in the first sharing template may be more or less than that included in the second sharing template. In some cases, the configuration templates may contain information that only supports sharing in mini-programs and not in apps, and correspondingly, may contain information that only supports sharing in apps and not in mini-programs. Therefore, the content included in the first and second sharing templates may be the same or different.
[0097] It is understandable that the above configuration template can be preset and configured by operations personnel and stored in the storage device of control device 101. The configuration template defines the page sharing information corresponding to the front-end page shared by the user, such as the page sharing information corresponding to the AAA content in the above scenario. Specifically, operations personnel can define the page sharing information using custom fields or in key-value format, which will not be elaborated here.
[0098] The technical solution provided in this application distinguishes different client types and converts the configuration template based on the client type to a sharing template suitable for different sharing tools. This allows operators to configure a universal template when configuring page sharing information, thereby improving their work efficiency.
[0099] With the technical solution provided in this application, when configuring page sharing of user-shared content, operators only need to configure one template, without having to set separate templates for different manufacturers' clients or different types of clients. This can reduce the workload of operators and thus improve their work efficiency.
[0100] Optionally, the storage device of the control device 101 can be a database or a cloud storage device, such as the memory, external storage or cloud storage service of the control device 101, etc., without any restrictions.
[0101] This application embodiment can divide the page sharing device into functional modules or functional units according to the above method example. For example, each function can be divided into a separate functional module or functional unit, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or in software functional modules or functional units. The module or unit division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.
[0102] like Figure 3 The diagram shown is a structural schematic of a page sharing device provided in an embodiment of this application. The device includes:
[0103] The communication unit 202 is used to receive a page sharing request sent by the client and obtain the client type based on the page sharing request; the page sharing request requests page sharing information of at least one front-end page, and the client type includes: application (APP) type and mini-program type;
[0104] The processing unit 201 is used to convert the preset configuration template in response to the client type being APP type, to obtain the first sharing template, and to call the first sharing template using the APP sharing tool; the configuration template is a configuration template for page sharing information, used to indicate the page sharing information to be displayed on the client, and the first sharing template meets the template rules of the APP sharing tool;
[0105] In response to the client type being a mini-program, the configuration template is converted to obtain a second sharing template, and the mini-program sharing tool is used to call the second sharing template; the second sharing template meets the template rules of the mini-program sharing tool.
[0106] As one possible implementation, the aforementioned APP sharing tool is a JSSDK. Before calling the first sharing template using the APP sharing tool, the processing unit 201 is further configured to:
[0107] Check if the client has a built-in JSSDK. If not, load the JSSDK.
[0108] As one possible implementation, the mini-program sharing tool is onShareAppMessage. Before calling the second sharing template using the mini-program sharing tool, the processing unit 201 is further configured to:
[0109] Use the postMessage tool to send the second sharing template to the client's webview container;
[0110] Receive the second sharing template using the receiving tool bindmessage.
[0111] As one possible implementation, the client type is obtained based on the page sharing request, including:
[0112] The client type is obtained by matching the navigator.userAgent field included in the page sharing request using regular expressions.
[0113] When implemented in hardware, the communication unit 202 in this embodiment can be integrated onto the communication interface, and the processing unit 201 can be integrated onto the processor. Specific implementation methods are as follows: Figure 4 As shown.
[0114] Figure 4 A schematic diagram of another possible structure of the page sharing device involved in the above embodiments is shown. The page sharing device includes a processor 302 and a communication interface 303. The processor 302 is used to control and manage the operation of the page sharing device, for example, executing the steps performed by the processing unit 201, and / or performing other processes of the technology described herein. The communication interface 303 is used to support communication between the page sharing device and other network entities, for example, executing the steps performed by the communication unit 202. The page sharing device may also include a memory 301 and a bus 304, the memory 301 being used to store the program code and data of the page sharing device.
[0115] The memory 301 may be a memory in a page sharing device, and the memory may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk or solid-state drive; the memory may also include a combination of the above types of memory.
[0116] The processor 302 described above can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0117] Bus 304 can be an Extended Industry Standard Architecture (EISA) bus, etc. Bus 304 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0118] Figure 5 This is a schematic diagram of the structure of chip 170 provided in an embodiment of this application. Chip 170 includes one or more (including two) processors 1710 and communication interfaces 1730.
[0119] Optionally, the chip 170 also includes a memory 1740, which may include read-only memory and random access memory, and provides operation instructions and data to the processor 1710. A portion of the memory 1740 may also include non-volatile random access memory (NVRAM).
[0120] In some implementations, memory 1740 stores elements such as execution modules or data structures, or subsets thereof, or extended sets thereof.
[0121] In this embodiment of the application, the corresponding operation is executed by calling the operation instructions stored in the memory 1740 (the operation instructions can be stored in the operating system).
[0122] The processor 1710 described above can implement or execute various exemplary logic blocks, units, and circuits described in conjunction with the disclosure of this application. The processor can be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logic blocks, units, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0123] The memory 1740 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk or solid-state drive; the memory may also include combinations of the above types of memory.
[0124] The Bus 1720 can be an Extended Industry Standard Architecture (EISA) bus, etc. The Bus 1720 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The symbol is represented by only one line, but this does not mean that there is only one bus or one type of bus.
[0125] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0126] This application provides a computer program product containing instructions that, when run on a computer, cause the computer to execute the page sharing method described in the above method embodiments.
[0127] This application also provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the page sharing method in the method flow shown in the above method embodiments.
[0128] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: electrical connections having one or more wires; portable computer disks; hard disks; random access memory (RAM); read-only memory (ROM); erasable programmable read-only memory (EPROM); registers; hard disks; optical fibers; portable compact disc read-only memory (CD-ROM); optical storage devices; magnetic storage devices; or any suitable combination thereof; or any other form of computer-readable storage medium known in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may reside in an application-specific integrated circuit (ASIC). In the embodiments of this application, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0129] Embodiments of the present invention provide a computer program product containing instructions that, when executed on a computer, cause the computer to perform actions such as... Figure 2 The page sharing method described in [the document].
[0130] Since the page sharing device, computer-readable storage medium, and computer program product in the embodiments of the present invention can be applied to the above methods, the technical effects they can achieve can also be referred to the above method embodiments. The embodiments of the present invention will not be described again here.
[0131] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0132] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0133] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0134] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for sharing a webpage, characterized in that, The method includes: Receive a page sharing request sent by a client, and obtain the client type based on the page sharing request; the page sharing request requests page sharing information of at least one front-end page, and the client type includes: application (APP) type and mini-program type; In response to the client type being an APP, a preset configuration template is converted to obtain a first sharing template. It is then determined whether the client has a built-in APP sharing tool. If not, the APP sharing tool is loaded and used to call the first sharing template. The APP sharing tool is a JSSDK. The configuration template is a configuration template for the page sharing information, used to indicate the page sharing information displayed by the client. The configuration template includes the configuration information required by the first sharing template. The first sharing template satisfies the template rules of the APP sharing tool. In response to the client type being a mini-program, the configuration template is converted to obtain a second sharing template. The second sharing template is then transmitted to the client's webview container using the postMessage sending tool. The second sharing template is received using the bindMessage receiving tool. The second sharing template is then invoked using the mini-program sharing tool, onShareAppMessage. The configuration template includes the configuration information required by the second sharing template. The second sharing template conforms to the template rules of the mini-program sharing tool.
2. The method according to claim 1, characterized in that, The method of obtaining the client type based on the page sharing request includes: The client type is obtained by matching the navigator.userAgent field included in the page sharing request using regular expressions.
3. A page sharing device, characterized in that, The device includes: A communication unit is used to receive a page sharing request sent by a client and obtain the client type based on the page sharing request; the page sharing request requests page sharing information of at least one front-end page, and the client type includes: application (APP) type and mini-program type; The processing unit is configured to, in response to the client type being an APP, convert a preset configuration template to obtain a first sharing template, determine whether the client has a built-in APP sharing tool, and if not, load the APP sharing tool and use it to call the first sharing template; the APP sharing tool is a JSSDK; the configuration template is a configuration template for the page sharing information, used to indicate the page sharing information displayed by the client, and the configuration template includes the configuration information required by the first sharing template; the first sharing template satisfies the template rules of the APP sharing tool; In response to the client type being a mini-program, the configuration template is converted to obtain a second sharing template. The second sharing template is then transmitted to the client's webview container using the postMessage sending tool. The second sharing template is received using the bindMessage receiving tool. The second sharing template is then invoked using the mini-program sharing tool, onShareAppMessage. The configuration template includes the configuration information required by the second sharing template. The second sharing template conforms to the template rules of the mini-program sharing tool.
4. The apparatus according to claim 3, characterized in that, The method of obtaining the client type based on the page sharing request includes: The client type is obtained by matching the navigator.userAgent field included in the page sharing request using regular expressions.
5. A page sharing device, characterized in that, The device includes: a processor and a communication interface; the communication interface is coupled to the processor, the processor being configured to run computer programs or instructions to implement the method as described in any one of claims 1-2.
6. A computer-readable storage medium storing instructions, characterized in that, When the computer executes the instruction, the computer performs the method described in any one of claims 1-2.
Citation Information
Patent Citations
Data sharing method and device, electronic equipment and storage medium
CN114036423A
