Instruction processing method, device, equipment and storage medium
Through the improved Cordova framework, multiple optional port protocols and target plug-ins are used to process application control instructions for browser pages, solving the problem of large size and high development costs of web application development data packages, and achieving lower cost functional implementation and renew.
Patent Information
- Application Number
- CN202210472851.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-29
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2042-04-29
AI Technical Summary
With the increase in web application functions, the existing technology requires writing related function plug-in code for each browser port protocol, resulting in large volume of development data packages and high development costs. In addition, plug-in needs to be written again when functions are updated, which increases the update cost.
Adopting the improved Cordova framework, at least two optional port protocols are deployed, the application control instructions sent by the browser page determine the application requirements, and select the target port protocol that supports the function from these protocols, and call the corresponding target plug-in to execute it. Directive to avoid developing relevant functional codes for each browser port protocol.
It reduces the volume and development costs of web application data packets, simplifies the function update process, and reduces the volume and update costs of update data packets.
Smart Images

Figure CN114895898B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, in particular to the field of Internet of Things and web application technology, and specifically to an instruction processing method, device, equipment and storage medium. Background Art
[0002] With the development of computer technology, the functions of web application products are becoming more and more abundant. However, with the increase of web application functions, the development data package of web application is also getting larger. Therefore, it is very important to reduce the size of web application development data package while ensuring the realization of web application functions. Summary of the invention
[0003] The present disclosure provides an instruction processing method, apparatus, device and storage medium.
[0004] According to one aspect of the present disclosure, there is provided an instruction processing method, comprising:
[0005] Determine application requirement functions based on application control instructions sent by the browser page;
[0006] Determine a target port protocol that supports the application requirement function from at least two optional port protocols deployed by the cross-platform core engine Cordova framework; wherein different optional port protocols support different application optional functions;
[0007] The target plug-in supporting the application requirement function under the target port protocol is called to execute the application control instruction.
[0008] According to another aspect of the present disclosure, there is provided an electronic device, the electronic device comprising:
[0009] at least one processor; and
[0010] a memory communicatively connected to at least one processor; wherein,
[0011] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor so that the at least one processor can execute the instruction processing method of any embodiment of the present disclosure.
[0012] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the instruction processing method of any embodiment of the present disclosure.
[0013] The solution of the embodiment of the present disclosure can reduce the size of web application data packets and the development cost of web application under the premise that the web application normally processes application control instructions.
[0014] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0016] Figure 1A is a flow chart of an instruction processing method provided according to an embodiment of the present disclosure;
[0017] Figure 1B It is a principle architecture diagram of an instruction processing method provided according to an embodiment of the present disclosure;
[0018] Figure 2 is a flow chart of an instruction processing method provided according to an embodiment of the present disclosure;
[0019] Figure 3 is a schematic diagram of an improved Cordova framework provided according to an embodiment of the present disclosure;
[0020] Figure 4 is a flow chart of an instruction processing method provided according to an embodiment of the present disclosure;
[0021] Figure 5 is a schematic diagram of an instruction processing device provided according to an embodiment of the present disclosure;
[0022] Figure 6 It is a block diagram of an electronic device used to implement the instruction processing method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0023] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0024] Before introducing this embodiment, it should be noted that a web application can support access by multiple different browsers. Accordingly, the web application needs to process application control instructions sent from different browsers (i.e., browser pages). Since different browsers usually send application control instructions to web applications based on their own browser port protocols (i.e., data transmission channel protocols), developers of web applications currently need to write relevant function plug-in codes for all application functions that can be realized by the web application for each browser port protocol of the browser that can interact with it, and encapsulate each browser port protocol and its relevant function plug-in code in the development data packet of the web application, so that the subsequent web application can execute the application control instructions from the plug-in of the relevant application function supported by the browser port protocol corresponding to the browser page by calling the local. However, with the increase of web application functions, writing relevant function plug-in codes for each browser port protocol will lead to the increasing size of the development data packet of the web application, and will also increase the development cost of the web application, which is in urgent need of improvement.
[0025] Figure 1A is a flow chart of an instruction processing method provided according to an embodiment of the present disclosure; Figure 1B It is a principle architecture diagram of an instruction processing method provided according to an embodiment of the present disclosure. The embodiment of the present disclosure is applicable to the situation where a web application processes application control instructions sent by a received browser page. The method can be executed by an instruction processing device, and the device can be implemented in software and / or hardware. Specifically, it can be executed by a web application deployed with an improved Cordova framework. The improvement process of the Cordova framework in this embodiment will be described in detail in subsequent embodiments. In other words, the research and development data package of the web application of this embodiment does not need to include the relevant function plug-in code corresponding to each browser port protocol that can be supported for access, but only needs to include the relevant program code of the improved Cordova framework. Figure 1A-1B As shown, the method for obtaining the data report provided in this embodiment may include:
[0026] S101, determining application requirement functions according to application control instructions sent by a browser page.
[0027] Among them, the browser page of this embodiment can be a related access page of any browser (such as a shell browser) that can access the web application. The application control instruction can be an instruction for controlling the relevant application functions of the web application, which can be a display interface of the web application displayed by the user based on the browser page, and the control instruction corresponding to a certain application function is triggered. For example, the application control instruction can be triggered by clicking the relevant function button on the interface, and the application control instruction can also be triggered by voice or gesture. The application requirement function can be the related function that the application control instruction needs to execute. For example, if the web application is a web map application, the application control instruction can be an account login instruction, and accordingly, the application requirement function is the account login function.
[0028] Optionally, one possible implementation method of the present embodiment for determining the application requirement function corresponding to the application control instruction is: locally recording in the web application the mapping relationship between the various application optional functions it supports and their corresponding application control instructions. For example, it may be a mapping relationship between the application optional function number and the application control instruction number. After receiving the application control instruction sent by the browser, the web application may search for the application requirement function corresponding to the application control instruction based on the mapping relationship stored locally. Another possible implementation method is: parsing the instruction content of the application control instruction, determining the operation content that the control instruction needs to perform, and then analyzing the function plug-in that needs to be called by the operation content, and using the function corresponding to the function plug-in as the application requirement function.
[0029] S102, determining a target port protocol that supports the application required function from at least two optional port protocols deployed by the Cordova framework.
[0030] Among them, the Cordova framework of this embodiment may be an improved Cordova framework, in which only the native port protocol of the Cordova framework, namely, the Cordova protocol, is deployed in the Cordova framework before the improvement. In addition to deploying its native port protocol, the improved Cordova framework of this embodiment also adds at least one other port protocol. In this embodiment, different optional port protocols deployed in the Cordova framework support different optional application functions. That is to say, each optional port protocol deployed in the Cordova framework supports optional application functions that other optional port protocols do not have. For example, Figure 1B As shown in the figure, the improved Cordova framework of this example deploys both native port protocols and new port protocols. The application optional functions 1 supported by the native port protocol include: calling function, check-in function and pop-up window function, etc. The application optional functions 2 included in the new port protocol include: login function, photo upload function and jump to third party function.
[0031] It should be noted that when the Cordova framework of this embodiment deploys the optional port protocol, the registration information, configuration information, and related plug-in codes supporting the optional functions of the optional port protocol may be deployed.
[0032] In addition, it should be noted that the optional application functions supported by each optional port protocol in this embodiment may be functions that can be implemented by the web application, or may not be functions that can be implemented by the web application. It is sufficient to ensure that all optional application functions supported by all optional port protocols deployed by the Cordova framework can cover all functions that need to be implemented by the web application.
[0033] Optionally, in the present embodiment, the Cordova framework locally deployed by the web application may record a mapping relationship between each optional port protocol deployed therein and the optional application function supported by the optional port protocol. After the web application determines the application requirement function corresponding to the currently received application control instruction, the optional port protocol with the function required by the application may be searched as the target port protocol through the correspondence between the optional port protocol recorded in the Cordova framework and the optional application functions supported by the optional port protocol.
[0034] For example, if S101 determines that the application requirement function of the application control instruction is an account login function, then based on Figure 1B The Cordova framework shown determines that the newly added port protocol supporting the login function deployed therein is the target port protocol.
[0035] S103, calling the target plug-in that supports the application requirement function under the target port protocol to execute the application control instruction.
[0036] The target plug-in may be a relevant program code written to realize the application requirement function based on the protocol content specified by the target port protocol and capable of realizing the application requirement function under the target port protocol.
[0037] Optionally, since the application requirement function is a function supported by the target port protocol, the target port protocol must contain relevant function plug-ins for implementing the application requirement function, namely, the target plug-ins. At this time, the web application can call the target plug-in that can support the application requirement function under the target port protocol through the relevant modules in the Cordova framework (such as the protocol distribution management module) to execute the received application control instructions. For example, the application control instructions can be used as the input of the target plug-in, and the relevant program code of the target plug-in can be run to complete the execution process of the application control instructions.
[0038] Optionally, in this embodiment, the web application can also use different methods to call the target plug-in that supports the application requirement function under the protocol to execute the application control instruction according to its deployment method in the Cordova framework for different target port protocols. The specific implementation method will be described in detail in the subsequent embodiments.
[0039] According to the scheme of the embodiment of the present disclosure, after receiving the application control instruction sent by the browser page, the web application first determines the application requirement function corresponding to the application control instruction, and then selects the target port protocol that supports the application requirement function from at least two optional port protocols deployed by the Cordova framework, and then calls the target plug-in that supports the application requirement function under the target port protocol to respond to the application control instruction. In this scheme, for the application control instruction sent by any browser, as long as any one of the at least two optional port protocols deployed by the Cordova framework supports the function, the control instruction can be responded to, and there is no need to limit that the function plug-in must be supported by the browser port protocol corresponding to the browser sending the control instruction to execute the application control instruction. In other words, this scheme can realize that the R&D personnel do not need to develop relevant function codes for each application function under different browser port protocols in the process of developing web applications, thereby reducing the volume of web application data packets and the development cost of web applications. In addition, when there is a function update in the web application, as long as any optional port protocol in the Cordova framework deployed in the web page supports the new function, there is no need to develop the function plug-in corresponding to the new function, thereby reducing the data packet volume and update cost of the web application update.
[0040] Optionally, at least two optional port protocols deployed in the improved Cordova framework of this embodiment include the native protocol of the Cordova framework (such as the Cordova protocol) and a newly added protocol, and the newly added protocol is at least one browser port protocol that can be accessed by a browser. Among them, the accessible browser can be a browser that is connected to the Cordova framework and can support access to web applications. The browser port protocol can be a data transmission channel protocol followed by the browser itself. The browser port protocols for different browsers are usually different. In this embodiment, the browser port protocols of each browser supported by the web application are deployed in the Cordova framework, and the relevant function plug-ins of the optional functions of the application that are already available in the browser port protocol of the browser can be directly used. There is no need to specially write plug-ins for the relevant optional functions, which further simplifies the complexity of the Cordova framework improvement process.
[0041] Figure 21 is a flowchart of an instruction processing method provided according to an embodiment of the present disclosure. Based on the above embodiment, the embodiment of the present disclosure further explains in detail how to call a target plug-in that supports application requirement functions under the target port protocol to execute application control instructions, such as Figure 2 As shown, the instruction processing method provided in this embodiment may include:
[0042] S201, determining application requirement functions according to application control instructions sent by the browser page.
[0043] S202, determining a target port protocol that supports the application requirement function from at least two optional port protocols deployed by the Cordova framework.
[0044] Among them, different optional port protocols support different application optional functions.
[0045] S203: Determine an instruction distribution method of the application control instruction based on the protocol type of the target port protocol.
[0046] Among them, the protocol types of each optional port protocol deployed by the Cordova framework in this embodiment include two types: the native protocol of the Cordova framework and the newly added protocol of the Cordova framework. That is, the protocol type of the port protocol (such as the Cordova protocol) contained in the original Cordova framework is the native protocol. After this solution improves the Cordova framework, the protocol type of the port protocol (such as the browser port protocol) newly added to the Cordova framework is a newly added protocol. The instruction distribution method is a method of distributing application control instructions to the target plug-in for execution. Optionally, the instruction distribution method of this embodiment includes: direct distribution and anti-registration distribution. Among them, anti-registration distribution is to distribute application control instructions by anti-registration.
[0047] Specifically, in this embodiment, if the protocol type of the target port protocol is the native protocol of the Cordova framework, for example, the target port protocol is the Cordova protocol, then the corresponding instruction distribution method is direct distribution; if the protocol type of the target port protocol is the new protocol of the Cordova framework, for example, the target protocol is the browser port protocol, then the corresponding instruction distribution method is anti-registration distribution.
[0048] S204, calling the target plug-in that supports the application requirement function under the target port protocol according to the instruction distribution method, and executing the application control instruction.
[0049] Optionally, for the native protocol of the Cordova framework, the relevant function plug-ins of the optional functions of the application supported by it are original to the Cordova framework. In this case, the target plug-in can be called by direct distribution, and the application control instruction can be sent to the target plug-in, that is, the application control instruction is directly distributed to the target plug-in that supports the application requirement function under the target port protocol, so that the target plug-in executes the application control instruction. Specifically, the target plug-in can be called and the application control instruction can be sent to the target plug-in, and then the target plug-in can be run to complete the execution operation of the application control instruction.
[0050] For the new protocols of the Cordova framework, the related functional plug-ins of the optional application functions supported by them are subsequently deployed in the Cordova framework. Since the corresponding port protocol is not the native protocol of the Cordova framework, it is not possible to distribute instructions directly, and it is necessary to distribute application instructions indirectly, that is, to distribute application control instructions through the anti-registration distribution method. That is, based on the anti-registration mechanism, the application control instructions are distributed to the target plug-in that supports the application requirement function under the target port protocol through the controller of the target port protocol, so that the target plug-in executes the application control instructions. Specifically, the application control instructions can be sent to the controller of the target port protocol. After receiving the application control instructions, the controller calls the target plug-in corresponding to the application requirement function through the anti-registration mechanism based on the registration information of the target port protocol to execute the application control instructions.
[0051] According to the solution of the embodiment of the present invention, after receiving the application control instruction sent by the browser page, the web application first determines the application requirement function corresponding to the application control instruction, and then selects the target port protocol that supports the application requirement function from at least two optional port protocols deployed by the Cordova framework, and determines different instruction distribution methods to call the target plug-in that supports the application requirement function to respond to the application control instruction according to the protocol type of the target port protocol. This solution introduces different instruction distribution methods for different types of target port protocols to call the target plug-in to distribute the application control instruction, which improves the flexibility of function plug-in calling and instruction distribution under different port protocols, thereby better ensuring the normal execution of the application control instruction of the web application.
[0052] Figure 3 is a schematic diagram of an improved Cordova framework provided according to an embodiment of the present disclosure;
[0053] Figure 3 Taking the example of connecting a shell browser and its related port protocols (such as bdapi protocol) in the Cordova framework, this paper introduces the improvement process of the existing Cordova framework in this solution. The main improvement is to deploy at least one configuration information that can be connected to the browser in the Cordova framework. The specific aspects include the following:
[0054] 1. Improvements to the framework controller. (1) Register the shell browser to use the relevant information of the Cordova protocol, for example, including configuring the network (web) properties supported by the shell browser, the Cordova capabilities supported by the shell browser, and the protocol headers supported by the shell browser; (2) Load the uniform resource locator (URL) of the shell browser for online detection. (3) Load the shell browser identifier. It should be noted that the purpose of loading the URL and identifier of the shell browser is to identify whether the received application control instruction comes from the shell browser that has been connected to the Cordova framework, so as to realize the consideration of the shell browser's unique processing requirements when processing the application control instruction sent by the shell browser page in the subsequent processing. For example, if the application control instruction is an account login instruction sent by the shell browser, and the shell browser has a dedicated login intercommunication function, then when executing the account login instruction, the login intercommunication function must be considered, that is, after the web page login is successful, the client's login status must also display the login status.
[0055] 2. Improvements to the network engine (i.e., web engine). This mainly involves adding shell browser-specific processing requirements to the network engine of the cordova framework, which may include but are not limited to: (1) Shell browser's own configuration, such as login interoperability, etc. (2) Shell browser data settings, for example, loading the local cordova.js file (which is the core part of the shell browser framework), stopping video playback when jumping to a page (because the web page often plays some videos, in order to ensure that the video stops after the page jumps, this configuration is made), shielding floating windows and other data configurations required by the shell browser. (3) Shell browser Cordova protocol proxy. This protocol proxy is mainly based on the Cordova framework without losing the shell browser-specific processing requirements. The shell browser-specific processing requirements are transmitted to the shell browser page through this proxy for response processing.
[0056] 3. Improvements to the protocol distribution management part. In the protocol layer of the Cordova framework, in addition to deploying the native port protocols of the Cordova framework (such as the Cordova protocol), new port protocols are also deployed, such as Figure 3 The bdapi protocol in the Cordova framework. That is, the protocol layer of the Cordova framework deploys at least two optional port protocols, and deploys the application optional functions of each port protocol at the same time, where different port protocols correspond to different application optional functions. Figure 3The optional functions of the applications corresponding to the Cordova protocol and the bdapi protocol are different. The protocol management and distribution module of the Cordova framework is used to parse the target protocol to be used from multiple optional port protocols according to the received control instructions, and then call the relevant function plug-in to implement the relevant functions under the target protocol. The specific implementation process is described in detail in the above embodiment and the following embodiment, and will not be repeated here.
[0057] It should be noted that the part of the Cordova framework used to interact with external pages (i.e. Figure 3 The network proxy part in ) continues to use the existing Cordova framework part.
[0058] Next, combine Figure 3 The improved Cordova framework shown, that is, the Cordova framework deployed with at least one configuration information that can access the browser, is Figure 4 The preferred example of the instruction processing method shown is introduced, which specifically includes the following steps:
[0059] S401, determining application requirement functions according to application control instructions sent by the browser page.
[0060] For example, Figure 3 As shown, the user can log in to the web application through the browser page provided by the shell browser business party, and trigger the application control instruction through the web application interface. The browser page will send the application control instruction triggered by the user to the web application, and the web application will parse the application requirement function corresponding to the application control instruction.
[0061] S402, determining a target port protocol that supports the application required function from at least two optional port protocols deployed by the Cordova framework.
[0062] Among them, different optional port protocols support different application optional functions.
[0063] For example, Figure 3 As shown, if the application requirement function is determined to be the account login function according to the application control instruction, then the target port protocol determined in this step is the new port protocol of the Cordova framework, that is, the bdapi protocol.
[0064] S403, according to the configuration information of the accessible browser corresponding to the browser page, calling the target plug-in supporting the application requirement function under the target port protocol, and executing the application control instruction.
[0065] The accessible browser corresponding to the browser page may be the browser to which the browser page belongs, and the browser has been connected to the Cordova framework, that is, the relevant configuration information of the browser has been deployed in the Cordova framework. Figure 3 The accessible browser in is a shell browser. Optionally, the configuration information of the accessible browser may include but is not limited to: the accessible browser recorded in the framework controller (such as Figure 3 The shell browser in the Cordova protocol uses the relevant information of the Cordova protocol, the URL of the accessible browser, the identifier of the accessible browser, and the exclusive processing requirements of the accessible browser recorded in the network engine. The browser port protocol corresponding to the accessible browser and the application optional functions of the browser port protocol can also be used as the configuration information of the browser.
[0066] Optionally, in the process of calling the target plug-in supporting the application function under the target port protocol to execute the application control instruction, the present embodiment may consider the configuration information of the browser (i.e., the access browser) corresponding to the browser page sending the application control instruction, for example, Figure 3 As shown, through the shell browser Cordova protocol agent in the network engine, the application control instructions sent by the shell browser page are responded to by taking into account the processing requirements of the Cordova framework and the exclusive processing requirements of the shell browser.
[0067] Preferably, one possible implementation method is: according to the URL configuration information of the browser-accessible browser corresponding to the browser page, detect whether the browser page is valid; if valid, call the target plug-in that supports the application requirement function under the target port protocol to execute the application control instruction. Specifically, the URL of the browser page that sends the application control instruction can be compared with the URL of the browser-accessible browser loaded in the improved Cordova framework (i.e., the legal URL of the browser-accessible browser) to determine whether the browser page that sends the application control instruction is a legal URL. If so, it means that the browser page is detected to be valid. At this time, the subsequent call to the target plug-in that supports the application requirement function under the target port protocol can be executed to execute the operation of the application control instruction. It should be noted that the specific implementation method of calling the target plug-in and executing the application control instruction has been introduced in the above embodiment and will not be repeated here. Before executing the application control instruction, this embodiment first verifies the legitimacy of the browser page that sends the application control instruction, avoids illegal pages controlling web applications, and improves the security of web application control.
[0068] Another implementation method is: according to the processing requirement configuration information of the accessible browser corresponding to the browser page, determine whether the application control instruction has a dedicated processing requirement; if so, call the target plug-in that supports the application requirement function under the target port protocol, and execute the application control instruction based on the dedicated processing requirement. Specifically, before calling the target plug-in that supports the application requirement function under the target port protocol to execute the application control instruction, the present embodiment can first compare the accessible browser identifier recorded in the improved Cordova framework according to the browser identifier corresponding to the browser page that sends the application control instruction. If it is consistent with a certain accessible browser identifier, it is further determined whether the accessible browser has configured a dedicated processing requirement in the network engine. If so, it is further analyzed whether the dedicated processing requirement of the accessible browser is related to the application control instruction processed this time. If so, the dedicated processing requirement associated with the application control instruction can be considered while calling the target plug-in to execute the application control instruction. Specifically, if the protocol type of the target protocol is the native protocol of the Cordova framework, the application control instruction and its associated dedicated processing requirement are directly distributed to the target plug-in that supports the application requirement function under the target port protocol, so that the target plug-in executes the application control instruction based on the dedicated processing requirement. If the protocol type of the target protocol is a new protocol of the Cordova framework, based on the deregistration mechanism, the application control instruction and its associated exclusive processing requirements are distributed to the target plug-in that supports the application requirement function under the target port protocol through the controller of the target port protocol, so that the target plug-in executes the application control instruction based on the exclusive processing requirement.
[0069] For example, Figure 3 As shown, if the application control instruction is an account login instruction, and the browser page that sends the application control instruction corresponds to the browser's exclusive processing requirement is login interoperability, then when the web application calls the login function plug-in to execute the account login instruction, the browser's login interoperability function must be considered, that is, after executing the account login instruction, while realizing the web page login, the client's login status must also be displayed as logged in.
[0070] If the application control instruction is an instruction to jump from the interface of the currently playing video to a third-party page, and the exclusive processing requirement of the browser corresponding to the browser that sends the application control instruction is to stop video playback when the page jumps, then before the web application calls the jump to the third-party function plug-in to execute the jump to the third-party page operation, it is necessary to first pause the video content playing on the page before the jump, and then execute the jump operation to the third-party page.
[0071] It should be noted that, in the process of executing application control instructions, the page application of this embodiment fully considers the exclusive processing requirements of the browser corresponding to the browser page that sends the application control instructions, and realizes flexible and personalized feedback for application control instructions sent to different accessible browsers, which is more in line with the actual exclusive needs of the browser currently sending the control instructions, thereby improving the flexibility and accuracy of the execution of application control instructions.
[0072] According to the solution of the embodiment of the present disclosure, after receiving the application control instruction sent by the browser page, the web application first determines the application requirement function corresponding to the application control instruction, and then selects the target port protocol that supports the application requirement function from at least two optional port protocols deployed by the Cordova framework, and then calls the target plug-in that supports the application requirement function under the target port protocol according to the configuration information of the accessible browser corresponding to the browser page to respond to the application control instruction. When calling the target plug-in to execute the application control instruction, this solution fully considers the configuration information of the accessible browser recorded in the improved Cordova framework, thereby improving the security and flexibility of the application control instruction execution process.
[0073] Figure 5 : is a schematic diagram of an instruction processing device provided according to an embodiment of the present disclosure. The embodiment of the present disclosure is applicable to the case where a web application processes an application control instruction sent by a received browser page. The device can be configured in a web application deployed with a Cordova framework, wherein the Cordova framework deployed in the web application of this embodiment is an improved Cordova framework, and the specific improvement process has been described in detail in the above embodiment. The device can be implemented by software and / or hardware, and the device can implement the instruction processing method disclosed in any embodiment of the present disclosure. Figure 5 As shown, the instruction processing device 500 includes:
[0074] The required function determination module 501 is used to determine the required application function according to the application control instruction sent by the browser page;
[0075] A target protocol determination module 502 is used to determine a target port protocol that supports the application requirement function from at least two optional port protocols deployed by the Cordova framework; wherein different optional port protocols support different application optional functions;
[0076] The instruction execution module 503 is used to call the target plug-in that supports the application requirement function under the target port protocol to execute the application control instruction.
[0077] According to the scheme of the embodiment of the present disclosure, after receiving the application control instruction sent by the browser page, the web application first determines the application requirement function corresponding to the application control instruction, and then selects the target port protocol that supports the application requirement function from at least two optional port protocols deployed by the Cordova framework, and then calls the target plug-in that supports the application requirement function under the target port protocol to respond to the application control instruction. In this scheme, for the application control instruction sent by any browser, as long as any one of the at least two optional port protocols deployed by the Cordova framework supports the function, the control instruction can be responded to, and there is no need to limit that the function plug-in must be supported by the browser port protocol corresponding to the browser sending the control instruction to execute the application control instruction. In other words, this scheme can realize that the R&D personnel do not need to develop relevant function codes for each application function under different browser port protocols in the process of developing web applications, thereby reducing the volume of web application data packets and the development cost of web applications. In addition, when there is a function update in the web application, as long as any optional port protocol in the Cordova framework deployed in the web page supports the new function, there is no need to develop the function plug-in corresponding to the new function, thereby reducing the data packet volume and update cost of the web application update.
[0078] Furthermore, the at least two optional port protocols of this embodiment include a native protocol of the Cordova framework and a newly added protocol, and the newly added protocol is at least one browser port protocol that can be accessed by a browser.
[0079] Furthermore, the instruction execution module 503 includes:
[0080] A distribution mode determining unit, configured to determine an instruction distribution mode of the application control instruction based on a protocol type of the target port protocol;
[0081] The instruction distribution execution unit is used to call the target plug-in that supports the application requirement function under the target port protocol according to the instruction distribution method to execute the application control instruction.
[0082] Further, if the protocol type of the target port protocol is the native protocol of the Cordova framework, the instruction distribution method is direct distribution;
[0083] Accordingly, the instruction distribution execution unit is specifically used for:
[0084] The application control instruction is directly distributed to a target plug-in that supports the application requirement function under the target port protocol, so that the target plug-in executes the application control instruction.
[0085] Furthermore, if the protocol type of the target port protocol is a new protocol of the Cordova framework, the instruction distribution method is anti-registration distribution;
[0086] Accordingly, the instruction distribution execution unit is specifically used for:
[0087] Based on the anti-registration mechanism, the application control instruction is distributed to the target plug-in supporting the application requirement function under the target port protocol through the controller of the target port protocol, so that the target plug-in executes the application control instruction.
[0088] Furthermore, the configuration information of the at least one accessible browser is deployed in the Cordova framework; accordingly, the instruction execution module 503 is specifically used for:
[0089] According to the configuration information of the accessible browser corresponding to the browser page, the target plug-in supporting the application requirement function under the target port protocol is called to execute the application control instruction.
[0090] Furthermore, the instruction execution module 503 is specifically used for:
[0091] Detecting whether the browser page is valid according to the browser-accessible uniform resource locator system URL configuration information corresponding to the browser page;
[0092] If valid, the target plug-in supporting the application requirement function under the target port protocol is called to execute the application control instruction.
[0093] Furthermore, the instruction execution module 503 is also specifically used for:
[0094] Determining whether the application control instruction has a dedicated processing requirement according to the processing requirement configuration information of the accessible browser corresponding to the browser page;
[0095] If yes, then the target plug-in that supports the application requirement function under the target port protocol is called to execute the application control instruction based on the exclusive processing requirement.
[0096] The above-mentioned product can execute the method provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0097] In the technical solution disclosed herein, the acquisition, storage and application of the control instructions, required functions, port protocols deployed by the Cordova framework, and configuration information of the browser connected to the Cordova framework, etc. of the web application involved all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0098] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0099] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0100] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0101] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0102] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as instruction processing methods. For example, in some embodiments, the instruction processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the instruction processing method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to execute the instruction processing method in any other appropriate manner (e.g., by means of firmware).
[0103] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0104] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0105] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0106] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0107] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0108] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services. The server may also be a server of a distributed system, or a server combined with a blockchain.
[0109] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, machine learning / deep learning technology, big data processing technology, knowledge graph technology, and other major directions.
[0110] Cloud computing refers to a technology system that uses network access to elastically scalable shared physical or virtual resource pools. Resources can include servers, operating systems, networks, software, applications, and storage devices, and can be deployed and managed on demand and in a self-service manner. Cloud computing technology can provide efficient and powerful data processing capabilities for technical applications such as artificial intelligence and blockchain, as well as model training.
[0111] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0112] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A command processing method, comprising: Determine application requirement functions based on application control instructions sent by the browser page; Determine a target port protocol that supports the application requirement function from at least two optional port protocols deployed by the cross-platform core engine Cordova framework; wherein the at least two optional port protocols include a native protocol and a newly added protocol of the Cordova framework, and the newly added protocol is at least one browser port protocol that can be accessed by a browser, and different optional port protocols support different application optional functions; Based on the protocol type of the target port protocol, a target plug-in supporting the application requirement function under the target port protocol is called to execute the application control instruction.
2. The method according to claim 1, wherein: The calling of the target plug-in supporting the application requirement function under the target port protocol to execute the application control instruction includes: Determining an instruction distribution method of the application control instruction based on the protocol type of the target port protocol; According to the instruction distribution mode, the target plug-in supporting the application requirement function under the target port protocol is called to execute the application control instruction.
3. The method according to claim 2, wherein: If the protocol type of the target port protocol is the native protocol of the Cordova framework, the instruction distribution method is direct distribution; Correspondingly, calling the target plug-in supporting the application requirement function under the target port protocol according to the instruction distribution mode to execute the application control instruction includes: The application control instruction is directly distributed to a target plug-in that supports the application requirement function under the target port protocol, so that the target plug-in executes the application control instruction.
4. The method according to claim 2, wherein: If the protocol type of the target port protocol is a new protocol of the Cordova framework, the instruction distribution method is anti-registration distribution; Correspondingly, calling the target plug-in supporting the application requirement function under the target port protocol according to the instruction distribution mode to execute the application control instruction includes: Based on the anti-registration mechanism, the application control instruction is distributed to the target plug-in supporting the application requirement function under the target port protocol through the controller of the target port protocol, so that the target plug-in executes the application control instruction.
5. The method according to any one of claims 1 to 4, wherein: Configuration information of the at least one accessible browser is deployed in the Cordova framework; Correspondingly, calling the target plug-in that supports the application requirement function under the target port protocol to execute the application control instruction includes: According to the configuration information of the accessible browser corresponding to the browser page, the target plug-in supporting the application requirement function under the target port protocol is called to execute the application control instruction.
6. The method according to claim 5, wherein: The step of calling the target plug-in supporting the application requirement function under the target port protocol according to the configuration information of the accessible browser corresponding to the browser page, and executing the application control instruction includes: Detecting whether the browser page is valid according to the browser-accessible uniform resource locator system URL configuration information corresponding to the browser page; If valid, the target plug-in supporting the application requirement function under the target port protocol is called to execute the application control instruction.
7. The method according to claim 5, wherein: The step of calling the target plug-in supporting the application requirement function under the target port protocol according to the configuration information of the accessible browser corresponding to the browser page, and executing the application control instruction includes: Determining whether the application control instruction has a dedicated processing requirement according to the processing requirement configuration information of the accessible browser corresponding to the browser page; If yes, then the target plug-in that supports the application requirement function under the target port protocol is called to execute the application control instruction based on the exclusive processing requirement.
8. An instruction processing device, comprising: A demand function determination module is used to determine the application demand function according to the application control instruction sent by the browser page; A target protocol determination module is used to determine a target port protocol that supports the application requirement function from at least two optional port protocols deployed by the Cordova framework; wherein the at least two optional port protocols include a native protocol and a newly added protocol of the Cordova framework, and the newly added protocol is at least one browser port protocol that can be accessed by a browser, and different optional port protocols support different application optional functions; The instruction execution module is used to call the target plug-in supporting the application requirement function under the target port protocol based on the protocol type of the target port protocol to execute the application control instruction.
9. The device according to claim 8, wherein: The instruction execution module includes: A distribution mode determining unit, configured to determine an instruction distribution mode of the application control instruction based on a protocol type of the target port protocol; The instruction distribution execution unit is used to call the target plug-in that supports the application requirement function under the target port protocol according to the instruction distribution method to execute the application control instruction.
10. The device according to claim 9, wherein: If the protocol type of the target port protocol is the native protocol of the Cordova framework, the instruction distribution method is direct distribution; Accordingly, the instruction distribution execution unit is specifically used for: The application control instruction is directly distributed to a target plug-in that supports the application requirement function under the target port protocol, so that the target plug-in executes the application control instruction.
11. The device according to claim 9, wherein: If the protocol type of the target port protocol is a new protocol of the Cordova framework, the instruction distribution method is anti-registration distribution; Accordingly, the instruction distribution execution unit is specifically used for: Based on the anti-registration mechanism, the application control instruction is distributed to the target plug-in supporting the application requirement function under the target port protocol through the controller of the target port protocol, so that the target plug-in executes the application control instruction.
12. The device according to any one of claims 8 to 11, wherein: Configuration information of the at least one accessible browser is deployed in the Cordova framework; Accordingly, the instruction execution module is specifically used for: According to the configuration information of the accessible browser corresponding to the browser page, the target plug-in supporting the application requirement function under the target port protocol is called to execute the application control instruction.
13. The device according to claim 12, wherein: The instruction execution module is specifically used for: Detecting whether the browser page is valid according to the browser-accessible uniform resource locator system URL configuration information corresponding to the browser page; If valid, the target plug-in supporting the application requirement function under the target port protocol is called to execute the application control instruction.
14. The device according to claim 12, wherein: The instruction execution module is also specifically used for: Determining whether the application control instruction has a dedicated processing requirement according to the processing requirement configuration information of the accessible browser corresponding to the browser page; If yes, then the target plug-in that supports the application requirement function under the target port protocol is called to execute the application control instruction based on the exclusive processing requirement.
15. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.
16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.
17. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Hybrid application construction method and device and computing equipment
CN113535275A
Method and apparatus for data interaction
US20210157555A1