Page sharing method, electronic device, readable storage medium

CN115269233BActive Publication Date: 2026-09-22CHINA PING AN LIFE INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211056976.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-31
Publication Date
2026-09-22
Estimated Expiration
2042-08-31

AI Technical Summary

Technical Problem

根据相关技术,页面共享提供端通过应用程序来调用原生能力的过程中,存在着将敏感性接口(例如支付业务相关的接口)暴露给应用程序的风险

Benefits of technology

[0035]本申请实施例的发明页面共享方法中,需要先获取页面共享指令,并基于页面共享指令建立与页面共享接收端之间的页面共享通讯,进而在页面共享通讯的过程中获取资源调用指令,其中资源调用指令用于调用页面共享提供端的本地原生资源。再进一步,对资源调用指令进行解析,得到容器调用信息,并根据容器调用信息,经由数据调用通道对本地原生资源进行调用,数据调用通道基于JSBridge通信方式进行数据传输,最终基于被调用的本地原生资源,在页面共享通讯中传输原生共享信息。根据本申请实施例的页面共享方法,基于JSBridge通信方式的数据调用通道,来根据容器调用信息来针对性地调用本地原生资源,隔离了应用程序运营方与本地原生资源敏感性接口之间的接触渠道,因而能够在页面共享提供端通过应用程序来调用原生能力的过程中提升数据安全性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115269233B_ABST
    Figure CN115269233B_ABST
Patent Text Reader

Abstract

The application relates to the computer technical field, in particular to a page sharing method, an electronic device and a readable storage medium. The page sharing method of the application first acquires a page sharing instruction, establishes page sharing communication with a page sharing receiving end based on the page sharing instruction, and then acquires a resource calling instruction in the process of the page sharing communication. Further, the resource calling instruction is analyzed to obtain container calling information, and the local native resource is called through a data calling channel according to the container calling information. The data calling channel performs data transmission based on a JSBridge communication mode. Finally, native sharing information is transmitted in the page sharing communication based on the local native resource, the local native resource is called in a targeted manner, the contact channel between an application program operator and a local native resource sensitive interface is isolated, and therefore the data security can be improved in the process of calling the native capability through the application program in the page sharing providing end.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a page sharing method, electronic device, and readable storage medium. Background Technology

[0002] With the advancement of technology, smart terminals have become indispensable tools in people's daily lives. In some cases, people need to share web pages through applications on smart terminals. When a web page sharing provider shares a web page with a web page sharing receiver, the application is often used as a platform medium to transmit the shared page data. Therefore, the web page sharing provider often needs to call native capabilities through the application to generate the shared page data. According to relevant technologies, there is a risk of exposing sensitive interfaces (such as payment-related interfaces) to the application during the process of the web page sharing provider calling native capabilities through the application. Therefore, how to improve data security during the process of the web page sharing provider calling native capabilities through the application has become a major challenge that urgently needs to be solved in the industry. Summary of the Invention

[0003] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a page sharing method that enhances data security during the process of a page sharing provider calling native capabilities through an application.

[0004] The page sharing method according to the first aspect of this application, applied to a page sharing provider, includes:

[0005] Obtain the page sharing instruction, and establish page sharing communication with the page sharing receiver based on the page sharing instruction;

[0006] During the page sharing communication process, a resource invocation instruction is obtained, which is used to invoke the local native resources of the page sharing provider.

[0007] The resource call instruction is parsed to obtain container call information;

[0008] Based on the container call information, the local native resources are invoked via a data call channel, which transmits data based on the JSBridge communication method;

[0009] Based on the invoked local native resources, native shared information is transmitted in the page sharing communication.

[0010] According to some embodiments of this application, the data invocation channel is used for data transmission between the target page and the local resource management module. The step of invoking the local native resource via the data invocation channel based on the container invocation information includes:

[0011] The container call information is injected into the JavaScript context environment information through the page interface of the target page;

[0012] The local resource management module obtains the context environment information through the data call channel, and parses the context environment information to obtain the target code;

[0013] Based on the calling object and calling method in the target code, the local native resources are invoked.

[0014] According to some embodiments of this application, parsing the context information to obtain the target code includes:

[0015] The context information is parsed to obtain the resource call statements within the context information;

[0016] By using preset conversion rules, the resource call statement is converted into the target code corresponding to the local programming environment.

[0017] According to some embodiments of this application, the page sharing instruction includes an application deployment instruction and a communication establishment instruction. The step of obtaining the page sharing instruction and establishing page sharing communication with the page sharing receiver based on the page sharing instruction includes:

[0018] According to the application deployment instructions, deploy the page communication function in the target application;

[0019] Once the page communication function is deployed, the page sharing communication is established based on the communication establishment command.

[0020] According to some embodiments of this application, deploying the page communication function in the target application according to the application deployment instruction includes:

[0021] Based on the application deployment instructions, the Fragment interface is called through the target application;

[0022] The page communication function is deployed via the Fragment interface.

[0023] According to some embodiments of this application, the step of calling the Fragment interface through the target application based on the application deployment instruction includes:

[0024] Obtain page sharing parameters and send the page sharing parameters to the operator of the target application;

[0025] Obtain the Fragment interface passed in by the operator, the Fragment interface being used to establish page sharing communication that matches the page sharing parameters.

[0026] According to some embodiments of this application, the step of calling the Fragment interface through the target application based on the application deployment instruction further includes:

[0027] Based on the application deployment instructions, an interface type comparison is performed in a preset database;

[0028] Based on the interface type comparison, the Fragment interface that matches the application deployment instruction is obtained.

[0029] According to some embodiments of this application, transmitting native shared information in the page sharing communication based on the invoked local native resource includes:

[0030] Based on the Activity component corresponding to the local native resources, the front-end and back-end usage status of the native shared information is detected;

[0031] When the native shared information is running in the background, the transmission of the native shared information is paused.

[0032] Secondly, embodiments of this application provide an electronic device, including: a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the page sharing method as described in any one of the embodiments of the first aspect of this application.

[0033] Thirdly, embodiments of this application provide a computer-readable storage medium storing a program that is executed by a processor to implement the page sharing method as described in any one of the embodiments of the first aspect of this application.

[0034] The page sharing method, electronic device, and readable storage medium according to the embodiments of this application have at least the following beneficial effects:

[0035] In the page sharing method of this application embodiment, it is necessary to first obtain a page sharing instruction and establish page sharing communication with the page sharing receiving end based on the page sharing instruction. Then, during the page sharing communication process, a resource invocation instruction is obtained, wherein the resource invocation instruction is used to invoke the local native resources of the page sharing provider. Further, the resource invocation instruction is parsed to obtain container invocation information, and based on the container invocation information, the local native resources are invoked via a data invocation channel. The data invocation channel transmits data based on the JSBridge communication method. Finally, based on the invoked local native resources, native sharing information is transmitted in the page sharing communication. According to the page sharing method of this application embodiment, the data invocation channel based on the JSBridge communication method is used to selectively invoke local native resources according to the container invocation information, isolating the contact channel between the application operator and the sensitive interfaces of local native resources. Therefore, it can improve data security when the page sharing provider invokes native capabilities through the application.

[0036] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0037] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:

[0038] Figure 1 This is a schematic flowchart of a page sharing method provided in an embodiment of this application;

[0039] Figure 2 This is a schematic flowchart of another page sharing method provided in an embodiment of this application;

[0040] Figure 3 This is a schematic flowchart of another page sharing method provided in an embodiment of this application;

[0041] Figure 4 This is a schematic flowchart of another page sharing method provided in an embodiment of this application;

[0042] Figure 5 This is a schematic flowchart of another page sharing method provided in an embodiment of this application;

[0043] Figure 6 This is a schematic flowchart of another page sharing method provided in an embodiment of this application;

[0044] Figure 7 This is a schematic flowchart of another page sharing method provided in an embodiment of this application;

[0045] Figure 8This is a schematic flowchart of another page sharing method provided in an embodiment of this application;

[0046] Figure 9 A schematic diagram of an electronic device for implementing the page sharing method of the embodiments of this application. Detailed Implementation

[0047] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.

[0048] In the description of this application, "several" means one or more, "more than" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.

[0049] In the description of this application, it should be understood that the orientation descriptions, such as up, down, left, right, front, and back, are based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.

[0050] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0051] In the description of this application, it should be noted that, unless otherwise explicitly defined, terms such as "setting," "installation," and "connection" should be interpreted broadly. Those skilled in the art can reasonably determine the specific meaning of the above terms in this application based on the specific content of the technical solution. Furthermore, the identification of specific steps in the following text does not imply a limitation on the order of steps or execution logic. The execution order and logic between each step should be understood and inferred from the content described in the embodiments.

[0052] With the advancement of technology, smart terminals have become indispensable tools in people's daily lives. In some cases, people need to share web pages through applications on smart terminals. When a web page sharing provider shares a web page with a web page sharing receiver, the application is often used as a platform medium to transmit the shared page data. Therefore, the web page sharing provider often needs to call native capabilities through the application to generate the shared page data. According to relevant technologies, there is a risk of exposing sensitive interfaces (such as payment-related interfaces) to the application during the process of the web page sharing provider calling native capabilities through the application. Therefore, how to improve data security during the process of the web page sharing provider calling native capabilities through the application has become a major challenge that urgently needs to be solved in the industry.

[0053] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a page sharing method that enhances data security during the process of a page sharing provider calling native capabilities through an application.

[0054] The following explanation is based on the accompanying drawings.

[0055] Reference Figure 1 The page sharing method according to the first aspect of this application, applied to a page sharing provider, includes:

[0056] Step S101: Obtain the page sharing instruction and establish page sharing communication with the page sharing receiver based on the page sharing instruction;

[0057] According to some embodiments provided in this application, a page sharing instruction refers to an instruction used to establish page sharing communication between a page sharing provider and a page sharing receiver. It should be clarified that page sharing communication refers to communication between terminals to share pages. Specifically, the page sharing provider shares the target page on its own terminal with the page sharing receiver, so that the page sharing receiver can learn about the information presented on the target page. It should be clarified that the target page is the shared page that the page sharing provider needs to provide to the page sharing receiver. According to some exemplary embodiments provided in this application, page sharing communication often needs to be implemented through screen recording and audio recording. One end (the page sharing provider) first records the video and audio information in the target page, and then transmits the recorded video and audio information to the other end (the page sharing receiver) through the network. It should be understood that the daily use of the above-mentioned page sharing communication requires a dedicated operator to provide development, operation, maintenance, and other business services related to page sharing communication. Therefore, in some embodiments provided in this application, page sharing communication often needs to be established in the operator's application (APP) and relies on the operator's application to maintain page sharing communication. It should be noted that page sharing instructions can be formed in various ways, including but not limited to being formed directly on the page sharing provider's end, on the page sharing receiver's end, or within the page sharing communication application. It should be understood that because page sharing instructions can be formed in various ways, the methods of obtaining them are also diverse. When a page sharing instruction is formed directly on the page sharing provider's end, it can be obtained through internal data transmission on the page sharing provider's end. When a page sharing instruction is formed on the page sharing receiver's end, it needs to be forwarded to the page sharing provider's end by the application for acquisition. When a page sharing instruction is formed within the page sharing communication application, the page sharing provider's end can obtain it by receiving the page sharing instruction transmitted from the application. It should be clarified that there are various ways to obtain page sharing instructions and establish page sharing communication with the page sharing receiver based on these instructions, including, but not limited to, the specific embodiments mentioned above.

[0058] Step S102: Obtain resource call instructions during the page sharing communication process. The resource call instructions are used to call the local native resources of the page sharing provider.

[0059] According to some embodiments provided in this application, different business needs may arise during page sharing communication, thus requiring the invocation of certain local native resources of the page sharing provider. For example, the need for video calls based on the page necessitates the invocation of native devices such as cameras and microphones on the page sharing provider; the need for account login based on the page requires the invocation of user identification numbers (IDs), usernames, and even login passwords stored locally on the page sharing provider; and the need for computational requests based on the target page requires the invocation of local computational programs on the page sharing provider to process the computational requests. It should be understood that the business needs generated during page sharing communication are diverse, therefore the corresponding local native resources of the page sharing provider that need to be invoked may include, but are not limited to, the specific types mentioned above. Therefore, during page sharing communication, corresponding resource invocation instructions will be obtained based on various business needs. It should be clarified that resource invocation instructions refer to instructions used to invoke local native resources of the page sharing provider.

[0060] According to some exemplary embodiments of this application, if page sharing communication needs to be established within the operator's application and relies on the operator's application to maintain page sharing communication, then correspondingly, it is necessary to call certain local native resources of the page sharing provider through the application. It is important to emphasize that during the process of the page sharing provider calling native capabilities through the application, sensitive interfaces (such as payment-related interfaces and privacy information calling interfaces) will be exposed to the application. Since the application is developed, operated, and maintained by a dedicated operator, there is a risk that the application will expose sensitive interfaces to the operator, resulting in data security vulnerabilities. In some embodiments of this application, the resource calling instruction can reflect the type of local native resource required for business implementation. Therefore, the page sharing provider can clarify the type of local native resource required for business implementation based on the resource calling instruction, thereby further providing the application with the corresponding local native resource interface. This isolates the contact channel between the application operator and the sensitive local native resource interface, thus improving data security during the process of calling local native capabilities through the application.

[0061] Step S103: Parse the resource call instruction to obtain container call information;

[0062] According to some embodiments provided in this application, resource invocation instructions can reflect the types of local native resources required for business implementation. The container invocation information obtained by parsing the resource invocation instructions is then used to map the invocation information to a specific container. For example, containers used to invoke native devices such as cameras and microphones; containers used to invoke locally stored user identification numbers (IDs), usernames, and other information; and containers used to invoke local computing programs to process computing requests. It should be understood that a container is a technology used to bind an application and all its necessary files into a runtime environment. As a unit, a container can be easily moved and run on any operating system in any environment. It needs to be clarified that the main purpose of container technology is to run applications within it and isolate them from the outside world, and to facilitate the transfer of this sandbox to other host machines. Essentially, it divides resources, files, devices, states, and configurations into an independent space through namespaces, control groups, and chroot technologies. Therefore, based on the container invocation information, the basis for associating resource invocation instructions with the required local native resources can be obtained. It should be understood that container invocation information varies depending on the resource invocation instruction, and the specific type of container corresponding to the container invocation information may include, but is not limited to, the specific embodiments mentioned above.

[0063] Step S104: Based on the container call information, invoke local native resources through the data call channel. The data call channel transmits data based on the JSBridge communication method.

[0064] According to some embodiments provided in this application, a data invocation channel refers to a data transmission channel used to transmit container invocation information and local native resources. Specifically, the data invocation channel is used to transmit container invocation information and local native resources between the target page and the local resource management module. In some embodiments of this application, the data invocation channel uses the JSBridge communication method for data transmission. It should be noted that JSBridge (JavaScriptBridge) refers to a means of communication between the target page (Webview) side and the local resource management module (Native) side. The target page can invoke the ability of local native resources through JavaScriptBridge, and local native resources can also execute some logic on the target page through JavaScriptBridge. It should be understood that JavaScript runs in a separate JavaScript environment (JS Context) (e.g., the Webkit engine or JSCore of the target page). Due to the natural isolation between these JavaScript environments and the native runtime environment, this situation can be compared with Remote Procedure Call (RPC) communication, and each mutual call between local native resources and JavaScript can be regarded as an RPC call.

[0065] According to some exemplary embodiments provided, the methods by which a target page calls local native resources may include, but are not limited to, two methods: API injection and URL Scheme interception. API injection refers to injecting objects or methods into the JavaScript JS Context through the page interface provided by the target page. This allows JavaScript to directly execute the corresponding code logic in the local native resource when invoked, thus achieving the purpose of calling the local native resource. It should be noted that the context information describes the JavaScript environment (JS Context) corresponding to the target page. URL Scheme interception, on the other hand, refers to the target page sending a URL Scheme request through certain methods (e.g., iframe.src). The local resource management module then intercepts the URL Scheme request and performs related operations based on the URL Scheme and its parameters, thereby achieving the purpose of calling the local native resource. It should be noted that a URL Scheme is a link similar to a URL, designed to facilitate direct inter-application calls. Its form is similar to a regular URL, the main difference being that hook functions such as protocol and host are generally custom-defined.

[0066] According to some exemplary embodiments provided, invoking local native resources via a data invocation channel based on container invocation information may specifically include: first obtaining a resource invocation instruction, then further parsing the resource invocation instruction to obtain container invocation information, which may include a bridge name, invocation execution parameters, and a callback function ID; further, determining the method or object corresponding to the container invocation information based on the bridge name, then executing the callback with the invocation execution parameters, and finally obtaining the return value through the callback function and sending the return value back to the target page, thus completing the invocation of local native resources via the data invocation channel. It should be understood that invoking local native resources via a data invocation channel based on container invocation information may include, but is not limited to, the specific embodiments described above.

[0067] Step S105: Based on the invoked local native resources, transmit native shared information in page sharing communication.

[0068] According to some embodiments provided in this application, after invoking local native resources via a data invocation channel based on container invocation information, native shared information can be transmitted in page sharing communication based on the invoked local native resources. Here, native shared information refers to page information formed based on local native resources that needs to be provided by the target page to the page sharing receiving end. It should be noted that different business requirements may arise during page sharing communication, necessitating the invocation of certain local native resources from the page sharing provider. Correspondingly, different native shared information is transmitted in page sharing communication based on the invoked local native resources to meet the diverse business requirements during page sharing communication. For example, the need for video calls based on a webpage requires accessing local native resources such as the webpage sharing provider's camera and microphone. The corresponding native shared information transmitted in the webpage sharing communication is the video information captured by the camera and the audio information recorded by the microphone. Similarly, the need for account login based on a webpage requires accessing local native resources such as the user's ID, username, and even login password stored locally on the webpage sharing provider. The corresponding native shared information transmitted in the webpage sharing communication is the same as the user's ID, username, and even login password. Furthermore, the need for computational requests based on a target page requires accessing local native resources such as the computational program installed locally on the webpage sharing provider. The corresponding native shared information transmitted in the webpage sharing communication is the computational result obtained by the computational program. It should be understood that the business requirements generated during webpage sharing communication are diverse, therefore the required local native resources accessed by the webpage sharing provider and the native shared information transmitted in the webpage sharing communication will also be diverse. It is important to emphasize that the methods for transmitting native shared information in webpage sharing communication based on the accessed local native resources can include, but are not limited to, the specific embodiments described above.

[0069] In the page sharing method of this application embodiment, it is necessary to first obtain a page sharing instruction and establish page sharing communication with the page sharing receiving end based on the page sharing instruction. Then, during the page sharing communication process, a resource invocation instruction is obtained, wherein the resource invocation instruction is used to invoke the local native resources of the page sharing provider. Further, the resource invocation instruction is parsed to obtain container invocation information, and based on the container invocation information, the local native resources are invoked via a data invocation channel. The data invocation channel transmits data based on the JSBridge communication method. Finally, based on the invoked local native resources, native sharing information is transmitted in the page sharing communication. According to the page sharing method of this application embodiment, the data invocation channel based on the JSBridge communication method is used to selectively invoke local native resources according to the container invocation information, isolating the contact channel between the application operator and the sensitive interfaces of local native resources. Therefore, it can improve data security when the page sharing provider invokes native capabilities through the application.

[0070] Reference Figure 2 According to some embodiments of this application, the data invocation channel is used to transmit data between the target page and the local resource management module, and to invoke local native resources via the data invocation channel according to container invocation information, including:

[0071] Step S201: Inject container call information into JavaScript context information through the page interface of the target page;

[0072] According to some embodiments provided in this application, the methods by which a target page calls local native resources may include, but are not limited to, two methods: API injection and URL interception scheme. API injection refers to injecting objects or methods into the JavaScript context through the page interface provided by the target page, allowing JavaScript to directly execute the corresponding code logic in the local native resources when called, thus achieving the purpose of calling the local native resources. It should be noted that in software engineering, a JavaScript context is an ordered sequence of properties that define the environment for objects residing within it. Context information is created during the activation of objects, where objects are configured to request certain automatic services, such as synchronization, transactions, real-time activation, security, etc. In computer technology, relative to a process, context information corresponds to the JavaScript context describing the process execution. Specifically, in the embodiments of this application, since the JavaScript context information is used to describe the JavaScript context corresponding to the target page, injecting container call information into the JavaScript context information through the target page's page interface is equivalent to injecting the call object or call method corresponding to the container call information into the JavaScript context. In some preferred embodiments of this application, the method names injected into the JavaScript context are the same as the corresponding method names of the local native resources. Therefore, the target page can directly use this exposed global JavaScript object under the global Window, and then call the native methods of the page sharing provider. It should be noted that injecting container call information into the JavaScript context information through the target page's page interface is not limited to the specific embodiments mentioned above.

[0073] Step S202: Obtain context environment information through the local resource management module via the data call channel, and parse the context environment information to obtain the target code;

[0074] According to some embodiments provided in this application, since the context information is used to describe the JavaScript environment (JS Context) corresponding to the target page, after the local resource management module obtains the context information through the data call channel, it further parses the context information to obtain the call object or call method injected in the context information that corresponds to the container call information. Furthermore, the call object or call method is converted using the programming syntax of the local resource management module to obtain the target code. It should be noted that the target code is specifically used to call local native resources in response to the container call information obtained from the data call channel. It should also be noted that the process of injecting container call information into the JavaScript context information through the target page's page interface follows JavaScript programming syntax. Therefore, when the programming syntax used by the local resource management module to call local native resources is inconsistent with JavaScript programming syntax, it is necessary to convert the call object or call method corresponding to the container call information using the programming syntax of the local resource management module to obtain the target code. It should be clarified that obtaining the context information through the local resource management module via the data call channel and parsing the context information to obtain the target code is not limited to the specific embodiments described above.

[0075] Step S203: Based on the calling object and calling method in the target code, call the local native resources.

[0076] According to some embodiments provided in this application, since the target code is used to call local native resources in response to container call information obtained from the data call channel, and the target code matches the programming syntax of the local resource management module, the call to local native resources can be completed based on the call object and call method in the target code. It should be clarified that the call object is the object called for the local native resource in the container call information, and the call method is the method called for the local native resource in the container call information.

[0077] It should be understood that through steps S201 to S203, the calling object and calling method corresponding to the container calling information can be passed to the local resource management module using contextual information as a medium. The local resource management module then matches the calling object and calling method with the corresponding programming syntax to form the target code, thus resolving the information calling barrier caused by differences in programming syntax. It should be noted that the Cordova plugin is an open-source project contributed by PhoneGap to Apache. It is the core code extracted from PhoneGap and the core engine driving PhoneGap. Because the Cordova plugin provides a set of device-related APIs, mobile applications can access native device functions using JavaScript, such as camera and microphone, from the native device on the page sharing provider. Furthermore, the Cordova plugin provides a unified set of JavaScript libraries and the device-related native backend code used by these libraries. In addition, the Cordova plugin supports various mobile operating systems, including iOS, Android, Ubuntu PhoneOS, Blackberry, Windows Phone, Palm WebOS, Bada, and Symbian. Therefore, in some preferred embodiments of this application, the Cordova plugin is used to execute steps S201 to S203 to realize the process of calling local native resources through the data call channel according to the container call information.

[0078] Reference Figure 3 According to some embodiments of this application, the context information is parsed to obtain the target code, including:

[0079] Step S301: Parse the context information to obtain the resource call statements in the context information;

[0080] According to some embodiments provided in this application, during the process of injecting container call information into the JavaScript context information through the page interface of the target page, a resource call statement corresponding to the container call information is randomly generated in the JavaScript context information. It should be noted that the resource call statement refers to program code used to call local native resources. It should be understood that the resource call statement includes a call object or call method corresponding to the container call information, and the call object or call method is formed during the process of injecting the container call information into the JavaScript context information. Therefore, in some embodiments of this application, the resource call statement follows the programming syntax specifications corresponding to JavaScript. Furthermore, when the programming syntax used by the local resource management module to call local native resources is inconsistent with the JavaScript programming syntax, the resource call statement needs to be adjusted according to the programming syntax of the local resource management module, converting the call object or call method corresponding to the container call information into target code that the local resource management module can recognize.

[0081] Step S302: Convert the resource call statement into target code corresponding to the local programming environment using preset conversion rules.

[0082] According to some embodiments provided in this application, after obtaining the resource call statement from the context environment information, the resource call statement is further converted into target code corresponding to the local programming environment through preset conversion rules. The preset conversion rules refer to pre-set rules that convert program code from one programming syntax specification to another based on the same programming logic. It should be understood that the preset conversion rules specifically embody the mapping relationship between different programming syntax specifications. Therefore, in order for the resource call statement to be recognized by the local resource management module and thus function as a caller of local native resources, some embodiments of this application convert the resource call statement into target code corresponding to the local programming environment through preset conversion rules. It should be noted that the preset conversion rules can be embodied in the protocol specification configured in the plugin program. The types of plugin programs are diverse, including open-source plugin programs like Cordova plugins, and plugin programs custom-encapsulated according to pre-configured protocol specifications. It should be emphasized that there are various ways to parse the context environment information to obtain the target code, including, but not limited to, the specific embodiments mentioned above.

[0083] Reference Figure 4 According to some embodiments of this application, the page sharing instruction includes an application deployment instruction and a communication establishment instruction. Obtaining the page sharing instruction and establishing page sharing communication with the page sharing receiver based on the page sharing instruction includes:

[0084] Step S401: Deploy the page communication function in the target application according to the application deployment instructions;

[0085] According to some embodiments provided in this application, a page sharing instruction refers to an instruction used to establish page sharing communication between a page sharing provider and a page sharing receiver. It should be clarified that page sharing communication refers to communication between terminals to share pages. Specifically, the page sharing provider shares the target page on its own terminal with the page sharing receiver, so that the page sharing receiver can learn about the information presented on the target page. It should be clarified that the target page is the shared page that the page sharing provider needs to provide to the page sharing receiver. According to some exemplary embodiments provided in this application, page sharing communication often needs to be implemented through screen recording and audio recording. One end (the page sharing provider) first records the video and audio information in the target page, and then transmits the recorded video and audio information to the other end (the page sharing receiver) through the network. It should be understood that the daily use of the above-mentioned page sharing communication requires a dedicated operator to provide development, operation, maintenance, and other business services related to page sharing communication. Therefore, in some embodiments provided in this application, page sharing communication often needs to be established in the operator's application and relies on the operator's application to maintain page sharing communication. It should be noted that page sharing instructions can be formed in various ways, including but not limited to being formed directly on the page sharing provider's end, on the page sharing receiver's end, or within the page sharing communication application. In some exemplary embodiments of this application, page sharing instructions include application deployment instructions and communication establishment instructions. It should be noted that application deployment instructions refer to instructions used to deploy page communication functions in a target application, where the target application refers to the application used to establish and maintain page sharing communication. Furthermore, communication establishment instructions refer to instructions used to initiate page sharing communication. According to some more specific embodiments of this application, in the process of deploying page communication functions in a target application based on application deployment instructions, it is necessary to first determine the target application for establishing page sharing communication based on the application deployment instructions, and then further determine the activation method of the page communication function in the target application. Once the target application and the activation method of the page communication function are clarified, the deployment of the page communication function is then completed. It should be understood that there are various ways to deploy page communication functions in a target application based on application deployment instructions, including, but not limited to, the specific embodiments mentioned above.

[0086] Step S402: Once the page communication function is deployed, establish page sharing communication based on the communication establishment command.

[0087] According to some embodiments provided in this application, after the page communication function in the target application is deployed according to the application deployment instructions, page sharing communication is further established based on the communication establishment instructions. It should be emphasized that the communication establishment instructions are one type of page sharing instructions, specifically used to initiate page sharing communication. It should be noted that in some exemplary embodiments of this application, when the page communication function is deployed, it means that the page sharing provider has clearly identified the target application for page sharing communication and the method for enabling the page communication function in the target application. Based on this, the page communication function in the target application can be further enabled based on the communication establishment instructions, thereby establishing page sharing communication through the target application. It should be understood that there are various ways to establish page sharing communication based on communication establishment instructions, including, but not limited to, the specific embodiments described above.

[0088] Reference Figure 5 According to some embodiments of this application, the page communication function in the target application is deployed according to the application deployment instructions, including:

[0089] Step S501: Based on the application deployment instruction, the Fragment interface is called through the target application;

[0090] Step S502: Deploy the page communication function via the Fragment interface.

[0091] In some exemplary embodiments of this application, the page sharing instructions include application deployment instructions and communication establishment instructions. It should be noted that the application deployment instructions refer to instructions used to deploy page communication functions in a target application, where the target application refers to the application used to establish and maintain page sharing communication. According to some more specific embodiments of this application, in the process of deploying page communication functions in a target application based on the application deployment instructions, it is necessary to first determine the target application for establishing page sharing communication based on the application deployment instructions, and then further determine the method for enabling page communication functions in the target application. Once the target application and the method for enabling page communication functions are clarified, the deployment of page communication functions is then completed. It should be noted that enabling page communication functions in the target application often requires implementation through the application interface (API) of the page sharing provider. It should be noted that for the same set of screen information, it can be displayed reasonably well on a mobile phone, but on a large-screen tablet, the screen information may be excessively stretched, and the spacing between controls may be too large. Therefore, to solve the screen information distortion caused by screen size differences, Fragment can adapt the screen information in an app to both mobile phone and tablet sizes simultaneously. Specifically, Fragment is a new application interface introduced in Android 3.0. The Fragment interface was initially created to accommodate large-screen tablets, but it has since been incorporated into regular mobile phone development. Since Fragments depend on Activity components, they can be viewed as small Activity fragments. Fragments offer several advantages, including but not limited to: First, they can separate an Activity into multiple reusable components, eliminating the need to write all code into the Activity, and each Fragment has its own lifecycle and UI; second, they allow for easy creation of dynamic and flexible UI designs, adapting to different screen sizes, from phones to tablets; third, a Fragment is an independent module, tightly bound to an Activity, allowing for dynamic removal, addition, and swapping operations during Activity runtime; fourth, Fragment switching is smooth and lightweight; and fifth, Fragments can be nested, resulting in better UI effects. Therefore, in some specific embodiments of this application, the page communication function in the target application is deployed via the Fragment interface according to the application deployment instructions. Specifically, in this application, the target application first calls the Fragment interface based on the application deployment instructions, thereby further deploying the page communication function via the Fragment interface.It should be clarified that after deploying the page communication function via the Fragment interface, a portion of the screen area of ​​the page sharing provider can be recorded or captured through the Fragment. The target application can then further display the recorded or captured screen area to the page sharing receiver, thereby exposing the target page to be shared to the page sharing receiver. It should be emphasized that, depending on the application deployment instructions, there are various ways to deploy the page communication function in the target application, including, but not limited to, the specific embodiments mentioned above.

[0092] Reference Figure 6 According to some embodiments of this application, based on application deployment instructions, the Fragment interface is called through the target application, including:

[0093] Step S601: Obtain the page sharing parameters and send the page sharing parameters to the operator of the target application;

[0094] Step S602: Obtain the Fragment interface sent by the operator. The Fragment interface is used to establish page sharing communication that matches the page sharing parameters.

[0095] According to some embodiments provided in this application, page sharing parameters refer to parameters used to describe the page sharing area. It should be understood that page sharing communication corresponds to various application scenarios; therefore, the required page sharing area will vary depending on the application scenario. Thus, in some preferred embodiments of this application, it is necessary to first obtain the page sharing parameters, then send the page sharing parameters to the operator of the target application, and then obtain the Fragment interface passed by the operator. The Fragment interface is used to establish page sharing communication matching the page sharing parameters. Through the Fragment interface matching the page sharing parameters, a portion of the page sharing area provided by the page sharing provider is recorded or captured. Finally, the target application displays the recorded or captured screen area to the page sharing receiver, thereby exposing the target page to be shared to the page sharing receiver. It should be emphasized that, based on application deployment instructions, the target application's call to the Fragment interface can include, but is not limited to, the specific embodiments described above.

[0096] Reference Figure 7 According to some embodiments of this application, based on application deployment instructions, the Fragment interface is called through the target application, further comprising:

[0097] Step S701: Based on the application deployment instructions, perform interface type comparison in the preset database;

[0098] Step S702: Based on the interface type comparison, obtain the Fragment interface that matches the application deployment instructions.

[0099] According to some embodiments provided in this application, in addition to sending page sharing parameters to the operator of the target application to obtain Fragment interfaces for deploying page communication functions in the target application, interface type comparison can also be performed in a preset database based on application deployment instructions to obtain Fragment interfaces matching the application deployment instructions, thereby completing the deployment of page communication functions in the target application. It should be noted that the preset database refers to a pre-set database that stores multiple sets of Fragment interface-related data. In some embodiments of this application, to adapt to various application scenarios corresponding to page sharing communication, multiple sets of Fragment interfaces are configured in the preset database, where each set of Fragment interfaces corresponds to preset parameters of multiple sets of page sharing areas. According to some exemplary embodiments of this application, after obtaining the application deployment instructions, interface type comparison can be further performed in the preset database based on the application deployment instructions. The interface type comparison can be based on the page sharing area. If a preset parameter corresponding to the page sharing area is matched during the interface type comparison process, then the Fragment interface corresponding to the page sharing area can be obtained, thus obtaining the Fragment interface matching the application deployment instructions. It should be emphasized that, based on application deployment instructions, calling the Fragment interface through the target application can include, but is not limited to, the specific embodiments mentioned above.

[0100] Reference Figure 8 According to some embodiments of this application, based on the invoked local native resources, transmitting natively shared information in page sharing communication includes:

[0101] Step S801: Based on the Activity component corresponding to the local native resources, detect the front-end and back-end usage status of the native shared information;

[0102] It should be noted that native shared information refers to page information formed based on local native resources that needs to be provided by the target page to the page sharing receiver. It should also be noted that during page sharing communication, different business requirements may arise, necessitating the invocation of certain local native resources from the page sharing provider. Correspondingly, based on the invoked local native resources, different native shared information is transmitted during page sharing communication to meet the diverse business needs arising during the page sharing communication process. For example, the need for video calls based on a webpage requires accessing local native resources such as the webpage sharing provider's camera and microphone. The corresponding native shared information transmitted in the webpage sharing communication is the video information captured by the camera and the audio information recorded by the microphone. Similarly, the need for account login based on a webpage requires accessing local native resources such as the user's ID, username, and even login password stored locally on the webpage sharing provider. The corresponding native shared information transmitted in the webpage sharing communication is the same as the user's ID, username, and even login password. Furthermore, the need for computational requests based on a target page requires accessing local native resources such as the computational program installed locally on the webpage sharing provider. The corresponding native shared information transmitted in the webpage sharing communication is the computational result obtained by the computational program. It should be understood that the business requirements generated during webpage sharing communication are diverse, therefore the required local native resources accessed by the webpage sharing provider and the native shared information transmitted in the webpage sharing communication will also be diverse. It is important to emphasize that the methods for transmitting native shared information in webpage sharing communication based on the accessed local native resources can include, but are not limited to, the specific embodiments described above.

[0103] Step S802: When the native shared information is running in the background, pause the transmission of the native shared information.

[0104] According to some embodiments provided in this application, since a Fragment depends on an Activity component, it can be considered a small Activity, also known as an Activity fragment. Therefore, when a Fragment is used to establish and maintain page sharing communication in some embodiments of this application, the foreground and background usage status of the native shared information can be detected based on the Activity component corresponding to the local native resources. It should be noted that by periodically declaring page display and hiding in the Activity component, the pause and resumption of screen sharing can be controlled to ensure that the information on a page is not exposed when the page sharing provider exits a certain page. Specifically, Activity components have callbacks throughout their various lifecycle stages. When native shared information is switched to the background in the application, the corresponding lifecycle callback is `onStop`. When native shared information is switched to the foreground, the corresponding lifecycle callback is `onRestart`. Therefore, by listening to these callback methods, the foreground and background usage status of native shared information can be detected based on the Activity component corresponding to the local native resources. Furthermore, when the `onStop` lifecycle callback detects that native shared information is running in the background, the `pauseScreenCapture` method can be used to pause the sharing of native shared information. Similarly, when the `onRestart` lifecycle callback detects that native shared information has returned to the foreground, the `resumeScrennCapture` method can be used to resume the sharing of native shared information. It should be understood that if native shared information is running in the background, it means that there is no need to transmit native shared information between the page sharing provider and the page sharing output. If the application continues to call local native resources through the data call channel, it will create data security risks. Therefore, in some preferred embodiments of this application, the transmission of native shared information is controlled by detecting its foreground and background usage status to further improve data security. It should be understood that there are many ways to transmit native shared information in page sharing communication based on the invoked local native resources, which may include, but are not limited to, the specific embodiments mentioned above.

[0105] Figure 9 An electronic device 900 according to an embodiment of this application is shown. The electronic device 900 includes a processor 901, a memory 902, and a computer program stored on the memory 902 and executable on the processor 901. When the computer program is executed, it is used to perform the page sharing method described above.

[0106] The processor 901 and the memory 902 can be connected via a bus or other means.

[0107] The memory 902, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs, such as the page sharing method described in the embodiments of this application. The processor 901 implements the above-described page sharing method by running the non-transitory software program and instructions stored in the memory 902.

[0108] The memory 902 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and application programs required for at least one function. The data storage area may store the page sharing method described above. Furthermore, the memory 902 may include high-speed random access memory 902, and may also include non-transitory memory 902, such as at least one storage device, flash memory, or other non-transitory solid-state storage device. In some embodiments, the memory 902 may optionally include remotely located memories 902 relative to the processor 901, which can be connected to the electronic device 900 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0109] The non-transitory software program and instructions required to implement the above-described page sharing method are stored in memory 902. When executed by one or more processors 901, the above-described page sharing method is performed, for example, executing... Figure 1 Method steps S101 to S105, Figure 2 Method steps S201 to S203, Figure 3 Method steps S301 to S302, Figure 4 Method steps S401 to S402, Figure 5 Method steps S501 to S502, Figure 6 Method steps S601 to S602, Figure 7 Method steps S701 to S702, Figure 8 The method steps S801 to S802.

[0110] This application also provides a computer-readable storage medium storing computer-executable instructions for performing the page sharing method described above.

[0111] In one embodiment, the computer-readable storage medium stores computer-executable instructions that are executed by one or more control processors, for example, executing... Figure 1 Method steps S101 to S105, Figure 2 Method steps S201 to S203, Figure 3Method steps S301 to S302, Figure 4 Method steps S401 to S402, Figure 5 Method steps S501 to S502, Figure 6 Method steps S601 to S602, Figure 7 Method steps S701 to S702, Figure 8 The method steps S801 to S802.

[0112] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0113] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, storage device storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically include computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium. It should also be understood that the various implementation methods provided in this application can be arbitrarily combined to achieve different technical effects.

[0114] The above provides a detailed description of the preferred embodiments of this application. However, this application is not limited to the above-described embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.

Claims

1. A page sharing method, applied to a page sharing provider, characterized in that, include: Obtain the page sharing instruction, and establish page sharing communication with the page sharing receiver based on the page sharing instruction; During the page sharing communication process, a resource call instruction is obtained. The resource call instruction is used to call the local native resources of the page sharing provider. The resource call instruction reflects the type of local native resource that the business implementation needs to call. The page sharing provider can then clarify the type of local native resource that the business implementation needs to call based on the resource call instruction, provide the application with the corresponding local native resource interface, and isolate the contact channel between the application operator and the sensitive interface of local native resources. The resource call instruction is parsed to obtain container call information; Based on the container call information, the local native resources are invoked via a data call channel, which transmits data based on the JSBridge communication method; Based on the invoked local native resources, native shared information is transmitted in the page sharing communication.

2. The method according to claim 1, characterized in that, The data invocation channel is used for data transmission between the target page and the local resource management module. The step of invoking the local native resources via the data invocation channel based on the container invocation information includes: The container call information is injected into the JavaScript context environment information through the page interface of the target page; The local resource management module obtains the context environment information through the data call channel, and parses the context environment information to obtain the target code; Based on the calling object and calling method in the target code, the local native resources are invoked.

3. The method according to claim 2, characterized in that, The step of parsing the context information to obtain the target code includes: The context information is parsed to obtain the resource call statements in the context information; By using preset conversion rules, the resource call statement is converted into the target code corresponding to the local programming environment.

4. The method according to any one of claims 1 to 3, characterized in that, The page sharing instructions include application deployment instructions and communication establishment instructions. The process of obtaining the page sharing instructions and establishing page sharing communication with the page sharing receiver based on the page sharing instructions includes: According to the application deployment instructions, deploy the page communication function in the target application; Once the page communication function is deployed, the page sharing communication is established based on the communication establishment command.

5. The method according to claim 4, characterized in that, The step of deploying the page communication function in the target application according to the application deployment instruction includes: Based on the application deployment instructions, the Fragment interface is called through the target application; The page communication function is deployed via the Fragment interface.

6. The method according to claim 5, characterized in that, The step of calling the Fragment interface through the target application based on the application deployment instruction includes: Obtain page sharing parameters and send the page sharing parameters to the operator of the target application; Obtain the Fragment interface passed in by the operator, the Fragment interface being used to establish page sharing communication that matches the page sharing parameters.

7. The method according to claim 5, characterized in that, The step of calling the Fragment interface through the target application based on the application deployment instruction also includes: Based on the application deployment instructions, an interface type comparison is performed in a preset database; Based on the interface type comparison, the Fragment interface that matches the application deployment instruction is obtained.

8. The method according to any one of claims 1-3, 5-7, characterized in that, The transmission of native shared information in the page sharing communication based on the invoked local native resource includes: Based on the Activity component corresponding to the local native resources, the front-end and back-end usage status of the native shared information is detected; When the native shared information is running in the background, the transmission of the native shared information is paused.

9. An electronic device, characterized in that, include: A memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the page sharing method as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The storage medium stores a program that is executed by a processor to implement the page sharing method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Communication method and device based on JSBridge and storage medium

    CN110502708A

  • Interface sharing method and device, equipment and medium

    CN113378094A