WO2023071749A1 - 参数调整方法、装置、存储介质及电子装置 - Google Patents

参数调整方法、装置、存储介质及电子装置 Download PDF

Info

Publication number
WO2023071749A1
WO2023071749A1 PCT/CN2022/124212 CN2022124212W WO2023071749A1 WO 2023071749 A1 WO2023071749 A1 WO 2023071749A1 CN 2022124212 W CN2022124212 W CN 2022124212W WO 2023071749 A1 WO2023071749 A1 WO 2023071749A1
Authority
WO
WIPO (PCT)
Prior art keywords
target device
parameter
target
middleware
request
Prior art date
Application number
PCT/CN2022/124212
Other languages
English (en)
French (fr)
Inventor
曹亚南
Original Assignee
青岛海尔科技有限公司
海尔智家股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 青岛海尔科技有限公司, 海尔智家股份有限公司 filed Critical 青岛海尔科技有限公司
Publication of WO2023071749A1 publication Critical patent/WO2023071749A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Definitions

  • Embodiments of the present disclosure relate to the field of computer technology, and in particular, to a parameter adjustment method, device, storage medium, and electronic device.
  • Canvas is a new component of HTML5 (hereinafter referred to as H5). It is like a curtain on which JavaScript can be used to draw various charts, animations, etc. In the era without Canvas, drawing can only be realized with the help of Flash plug-in, and the page has to use JavaScript and Flash to interact. With Canvas, we no longer need Flash, and directly use JavaScript to complete the drawing.
  • HTML5 Canvas draws fonts on high-point-per-inch DPI (Dots Per Inch) devices with more pixels per square inch, such as mobile phones, tablets, and of course many high-end desktop computer monitors with high resolution and high DPI. , Pictures and graphics will become blurred.
  • DPI Dots Per Inch
  • the H5 end draws Fonts, pictures or graphics may become blurred, that is, there is a problem in the related technology that the H5 end sometimes cannot draw a clear picture. Therefore, how to make the H5 terminal draw a clear picture under any circumstances is a problem that needs to be solved urgently.
  • Embodiments of the present disclosure provide a parameter adjustment method, device, storage medium, and electronic device, so as to at least solve the problem in the related art that the success rate of drawing a clear image on the H5 terminal is not high.
  • a parameter adjustment method including: after the initialization operation is completed, obtaining the first parameter of the target device; sending the first parameter to the H5 terminal to indicate that the H5 The terminal adjusts the parameters of the target component based on the first parameter, wherein the H5 terminal includes the target component, and the target device is configured to display the operation information received through the target component.
  • a parameter adjustment method including: receiving the first parameter of the target device sent by the middleware; adjusting the parameter of the target component based on the first parameter, wherein the target device Set to display action messages received by the target component.
  • a parameter adjustment device including: an acquisition module, configured to acquire the first parameter of the target device after the initialization operation is completed; a first sending module, configured to The first parameter is sent to the H5 terminal to instruct the H5 terminal to adjust the parameters of the target component based on the first parameter, wherein the H5 terminal includes the target component, and the target device is set to display the Operational information received by the target component.
  • a parameter adjustment device including: a first receiving module configured to receive the first parameter of the target device sent by the middleware; an adjustment module configured to receive the first parameter based on the first parameter Adjusting parameters of a target component, wherein the target device is configured to display operational information received through the target component.
  • a computer-readable storage medium wherein a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to perform any one of the above-mentioned methods when running Steps in the examples.
  • an electronic device including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to perform any of the above Steps in the method examples.
  • FIG. 1 is a block diagram of a hardware structure of a mobile terminal according to a parameter adjustment method according to an embodiment of the present disclosure
  • FIG. 2 is a first flowchart of a parameter adjustment method according to an embodiment of the present disclosure
  • FIG. 3 is a second flowchart of a parameter adjustment method according to an embodiment of the present disclosure.
  • Fig. 4 is a flowchart of a parameter adjustment method according to a specific embodiment of the present disclosure
  • Fig. 5 is a system framework diagram according to a specific embodiment of the present disclosure.
  • FIG. 6 is a first structural block diagram of a parameter adjustment device according to an embodiment of the present disclosure.
  • FIG. 7 is a second structural block diagram of a parameter adjustment device according to an embodiment of the present disclosure.
  • FIG. 8 is a structural block diagram of an electronic device according to an embodiment of the present disclosure.
  • FIG. 1 is a block diagram of a hardware structure of a mobile terminal according to a parameter adjustment method according to an embodiment of the present disclosure.
  • the mobile terminal may include one or more (only one is shown in Figure 1) processors 102 (processors 102 may include but not limited to processing devices such as microprocessor MCU or programmable logic device FPGA, etc.) and a memory 104 configured to store data, wherein the mobile terminal may further include a transmission device 106 and an input/output device 108 configured to communicate.
  • processors 102 may include but not limited to processing devices such as microprocessor MCU or programmable logic device FPGA, etc.
  • a transmission device 106 and an input/output device 108 configured to communicate.
  • the mobile terminal may also include more or fewer components than those shown in FIG. 1 , or have a different configuration from that shown in FIG. 1 .
  • the memory 104 can be set to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the parameter adjustment method in the embodiment of the present disclosure, and the processor 102 executes the computer program stored in the memory 104 by running the Various functional applications and data processing are to realize the above-mentioned method.
  • the memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
  • the memory 104 may further include a memory that is remotely located relative to the processor 102, and these remote memories may be connected to the mobile terminal through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the transmission device 106 is configured to receive or transmit data via a network.
  • the specific example of the above network may include a wireless network provided by the communication provider of the mobile terminal.
  • the transmission device 106 includes a network interface controller (NIC for short), which can be connected to other network devices through a base station so as to communicate with the Internet.
  • the transmission device 106 may be a radio frequency (Radio Frequency, referred to as RF) module, which is configured to communicate with the Internet in a wireless manner.
  • RF Radio Frequency
  • FIG. 2 is a flow chart 1 of the parameter adjustment method according to an embodiment of the present disclosure. As shown in FIG. 2 , the process includes the following steps:
  • Step S202 when the initialization operation is completed, obtain the first parameter of the target device
  • Step S204 sending the first parameter to the H5 terminal to instruct the H5 terminal to adjust the parameters of the target component based on the first parameter, wherein the H5 terminal includes the target component, and the target device setting To display the operation information received by the target component.
  • the H5 terminal can adjust the parameters of the target component in the H5 terminal based on the first parameter, so that the parameters of the target component are consistent with the target
  • the purpose of matching the first parameter of the device is to enable the target device to clearly display the operation information received on the target component.
  • the execution subject of the above steps can be a background processor, or an H5 container, or an H5 terminal component, for example, a middleware between the H5 terminal and the native side, or a terminal, or a device equipped with human-computer interaction configured on a storage device capable processors, or processing devices or processing units with similar processing capabilities, but not limited thereto.
  • the following takes the middleware between the H5 end and the original side (hereinafter referred to as "middleware") to perform the above operations as an example (this is only an exemplary illustration, in actual operation, other devices or modules can also be used to perform the above operations operation) to explain:
  • the middleware obtains the first parameter of the target device after completing the initialization operation.
  • the target device can be a display, a tablet computer, a mobile phone, or other display devices.
  • the middleware can send The target device sends a request to obtain the first parameter of the target device.
  • the first parameter may include the pixel, resolution, DPI, or other device-side information of the target device, and then send the first parameter to the H5 terminal to indicate
  • the H5 end adjusts the parameters of the target component based on the first parameter.
  • the target component can be the Canvas on the H5 end, which instructs the H5 end to adjust the parameters of the Canvas, for example, adjust the parameters such as the width, height, and zoom ratio of the Canvas.
  • the H5 end uses JavaScript to draw various charts, fonts, For pictures or animations, etc., after the parameters of the target component (such as Canvas) are adjusted based on the first parameters of the target device, the pictures, icons or animations can be clearly displayed on the target device.
  • the middleware can monitor the information of the target device (such as the above-mentioned first parameter), and when the information of the target device changes, the parameters of the target component (such as Canvas) can be dynamically adjusted, which solves the problem in related technologies. There is a problem that the success rate of drawing a clear image on the H5 end is not high, and the effect of improving the success rate of drawing a clear image on the H5 end is achieved.
  • obtaining the first parameter of the target device includes: monitoring the target device to obtain a notification message sent by the target device, wherein the notification message is that the target device determines its own Sent after a parameter changes; acquire the first parameter included in the notification message; or receive a parameter acquisition request from the H5 end; acquire the first parameter of the target device based on the parameter acquisition request parameter.
  • the middleware can monitor and obtain the information of the target device, and when the information of the target device changes, it will send a real-time update notification message to the middleware, and the middleware can obtain the information included in the notification message after receiving the notification message.
  • the middleware will send a request to the target device during the initialization process to request to obtain the detailed information of the target device and complete the subscription of the middleware monitoring; or, the middleware can Receive a parameter acquisition request from the H5 end, for example, request a device attribute interface to request to obtain the first parameter of the target device.
  • the purpose of monitoring the target device by the middleware to obtain real-time parameter information of the target device can be achieved, and at the same time, the first parameter of the target device can also be obtained through the request device attribute interface.
  • the method further includes: receiving the The operation data sent by the H5 terminal, wherein the operation data is the data obtained after the H5 terminal converts the operation behavior received by the target component; the operation data is sent to the target device to instructing the target device to display the operation information based on the operation data, where the operation information includes a pattern corresponding to the operation behavior.
  • the middleware can receive the operation data sent by the H5 side. For example, after the user interacts with the device on the H5 side, the H5 side converts the user's operation behavior into operation data and sends it to the middleware.
  • the middleware The software sends the operation data to the target device, so that the target device can display the operation information based on the operation data.
  • the user draws graphics, fonts, pictures or animations on the H5 side, and the target device can display the corresponding operation behavior based on the operation data. pattern.
  • the purpose of displaying the operation behaviors received by the target component on the target device after adjusting the parameters of the target component is achieved.
  • the method further includes: receiving the target A display result returned by the device, wherein the display result is used to indicate whether the target device has successfully displayed the operation information; a response message is fed back to the H5 terminal based on the display result.
  • the middleware receives the display result returned by the target device, and the display result is used to indicate whether the target device displays successfully, and based on the display result, the H5 terminal feedback response message.
  • the method before obtaining the first parameter of the target device, further includes: sending a request command to the target device when receiving the calling command sent by the H5 terminal , to request the target device to feed back the target information of the target device and request to perform a monitoring operation on the target device; and receive the target information fed back by the target device to complete the initialization operation.
  • the middleware needs to complete the initialization operation. For example, when receiving the call instruction sent by the H5 end, the middleware will send a request to the target device, and the target device receives After receiving the request, it will feed back the detailed information of the current target device to the middleware.
  • the detailed information includes the pixel, resolution, DPI and other parameter information of the target device, and completes the subscription of the middleware monitoring.
  • the middleware receives the detailed information returned by the target device. information, the initialization operation is complete. Through this embodiment, the purpose of initializing the middleware is achieved.
  • FIG. 3 is a flow chart 2 of the parameter adjustment method according to an embodiment of the present disclosure. As shown in FIG. 3 , the process includes the following steps:
  • Step S302 receiving the first parameter of the target device sent by the middleware
  • Step S304 adjusting the parameters of the target component based on the first parameter, wherein the target device is configured to display the operation information received through the target component.
  • the parameters of the target component can be matched with the first parameters of the target device, and then the target can be The device can clearly display the operation information received on the target component. Realized the adjustment of the parameters of the target component based on the first parameter of the target device to achieve the purpose of matching the first parameter of the target device, and solved the problem in the related technology that the success rate of drawing a clear picture on the H5 end is not high , thus achieving the effect of improving the success rate of drawing clear images on the H5 side.
  • the executor of the above steps may be H5 terminal, or terminal, or web page terminal, or a processor equipped with human-computer interaction capability configured on a storage device, or a processing device or processing unit with similar processing capability, etc. But not limited to this.
  • the following takes the H5 terminal to perform the above operations as an example (it is only an exemplary description, and other devices or modules can also be used to perform the above operations in actual operation) for illustration:
  • the H5 end receives the first parameter of the target device sent by the middleware.
  • the target device can be a display, a tablet computer, a mobile phone, or other display devices.
  • the middleware can send a request to the target device , to request to obtain the first parameter of the target device, for example, the first parameter may include the target device’s pixel, resolution, DPI, or other device-side information, and then send the first parameter to the H5 side, and then the H5 side can
  • the first parameter adjusts the parameters of the target component.
  • the target component can be the Canvas on the H5 side, which instructs the H5 side to adjust the parameters of the Canvas. For example, adjust the parameters such as the width, height, and zoom ratio of the Canvas.
  • the Canvas Adjust the parameters to match the first parameter of the target device, so that the target device can clearly display the operation information received on the target component
  • the H5 end uses JavaScript to draw various charts, fonts, pictures or animations on the Canvas, etc.
  • the parameters of the target component such as Canvas
  • pictures, icons or animations can be clearly displayed on the target device.
  • the H5 terminal can first send a request to the middleware, for example, requesting the device attribute interface to request the real-time parameter information of the target device, and the middleware can also monitor the information of the target device (such as the first parameter above) , when the information on the target device side changes, the changed first parameter can be sent to the H5 side, so that the H5 side can dynamically adjust the parameters of the target component (such as Canvas), which solves the problem of clear drawing on the H5 side in related technologies
  • the target component such as Canvas
  • the method before receiving the first parameter of the target device sent by the middleware, the method further includes: sending a parameter acquisition request to the middleware to request the middleware to acquire the target device The first parameter of .
  • a parameter acquisition request may be sent to the middleware to request acquisition of the first parameter of the target device, for example, requesting a device attribute interface to request acquisition of parameter information of the target device, such as the above-mentioned first parameter.
  • the purpose of requesting to obtain the parameters of the target device can be achieved by sending a request device attribute interface.
  • the method further includes: sending operation data to the middleware to instruct the middleware to send the operation data to to the target device and display operation information based on the operation data, wherein the operation data is data obtained after converting the operation behavior received by the target component, and the operation information includes the operation information obtained by the operation behavior corresponding pattern.
  • the H5 end sends operation data to the middleware. For example, after the user interacts with the device on the H5 side, the H5 side converts the user's operation behavior into operation data and sends it to the middleware, and instructs the middleware to The operation data is sent to the target device, so that the target device can display operation information based on the operation data.
  • the user draws graphics, fonts, pictures or animations on the H5 side, and the target device can display patterns corresponding to the operation behavior based on the operation data.
  • the purpose of displaying the operation behaviors received by the target component on the target device after adjusting the parameters of the target component is achieved.
  • the method further includes: receiving feedback from the middleware A response message, wherein the response message is sent by the middleware after receiving a display result returned by the target device, and the display result is used to indicate whether the target device has successfully displayed the operation information.
  • the target H5 end will receive the response message fed back by the middleware, for example, after the target device displays the result, it will be fed back to Successful information on the H5 side.
  • the method before receiving the first parameter of the target device sent by the middleware, the method further includes: sending an invocation instruction to the middleware to instruct the middleware to perform a predetermined operation, wherein, The predetermined operation includes: sending a request instruction to the target device to request the target device to feed back the target information of the target device and request to perform a monitoring operation on the target device; receiving the target device fed back by the target device information to complete the initialization operation.
  • the H5 terminal before the H5 terminal receives the first parameter sent by the middleware, it sends a call instruction to the middleware, for example, calls the initialization API interface of the middleware, and after the initialization API interface of the middleware is triggered, it will send a call instruction to the target device After sending a request, the target device will feed back the detailed information of the current target device to the middleware after receiving the request, and complete the subscription of the middleware monitoring. After the middleware receives the detailed information returned by the target device, it will complete the initialization operation.
  • the purpose of invoking the middleware to make the middleware perform an initialization operation is achieved.
  • Fig. 4 is a flowchart of a parameter adjustment method according to a specific embodiment of the present disclosure. As shown in Fig. 4, the process includes the following steps:
  • the H5 side (corresponding to the aforementioned H5 end) calls the middleware initialization API, the H5 side project first introduces the middleware, and after the project is successfully initialized, calls the middleware initialization API interface;
  • the middleware requests initialization resources, and after the initialization API interface of the middleware is triggered, it will send a request to the high-dpi device (corresponding to the aforementioned target device, for example, a mobile phone, a browser, an external display, etc.);
  • the high-dpi device corresponding to the aforementioned target device, for example, a mobile phone, a browser, an external display, etc.
  • the high-dpi device feeds back resources, the high-dpi device receives the request, and will feed back the detailed information of the current high-dpi device (corresponding to the aforementioned target information) to the middleware, and complete the subscription of the middleware monitoring;
  • the initialization is successful. After the middleware receives the detailed information returned by the high-dpi device, the middleware is initialized successfully;
  • the H5 side obtains the device attribute interface, and after the middleware is initialized successfully, the H5 side can send a request (corresponding to the aforementioned parameter acquisition request) to the device attribute interface to obtain information on the high-dpi device side;
  • the middleware monitors the device change, and obtains the information of the high-dpi device through the middleware monitor;
  • the high-dpi device returns device data, for example, when the high-dpi device changes, it will send a real-time update notification to the middleware;
  • the middleware returns data to the front end, the middleware receives the notification, and can push the information in the high-dpi device notification to the H5 side, and the notification message includes the changed parameters of the high-dpi device (corresponding to the aforementioned first parameter);
  • the H5 side sends data to the middleware, for example, after the user interacts with the device on the H5 side, the H5 side converts the user's operation behavior into data, and uses the API interface of the middleware to send the data;
  • the high dpi device returns the data result, and the high dpi device receives the data and records it in real time;
  • the middleware returns the requested data, and the high-dpi device feeds back success information to the H5 side through the middleware.
  • H5 relies on middleware in the project, and the middleware exposes the API interface to H5 as the H5 project is initialized; the H5 side uses the API interface exposed by the middleware to obtain data on the high-dpi device side; the middleware can monitor On the high dpi device side, the width, height and zoom ratio of the canvas can be dynamically adjusted according to the dpi of the device; after the user operates the device on the H5 side, the operation data can be transmitted to the high dpi device side through the middleware, and the high dpi device side is updated in real time Current latest data.
  • step S410 is an optional way to obtain the parameters of the high dpi device, but this step is not necessary, and the middleware in step S412 can monitor the device change to obtain the real-time change of the high dpi device Parameter information.
  • the middleware uniformly processes the data returned by the high-dpi device end, and the same interface is used in different environments to achieve the effect that the returned data format is consistent.
  • Fig. 5 is a system frame diagram according to a specific embodiment of the present disclosure. As shown in Fig. 5, the system includes: H5 container 502, high dpi device 504, and database 506, wherein, H5 container 502 includes: H5 side 5022, middleware 5024 ;
  • the data source is obtained from the database 506 of the server.
  • Both the H5 side and the middleware rely on the h5 container to run.
  • the H5 side does not directly interact with high-dpi devices for data.
  • the data is transferred and circulated through the middleware, which can be eliminated by the middleware. Differences caused by different systems and containers; data interaction between the high-dpi device side and the server can avoid confusion of data sources.
  • the method according to the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is Better implementation.
  • the technical solution of the present disclosure can be embodied in the form of a software product in essence or the part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM, disk, CD) contains several instructions to enable a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present disclosure.
  • FIG. 6 is a structural block diagram 1 of a parameter adjustment device according to an embodiment of the present disclosure. As shown in FIG. 6 , the device includes:
  • An acquisition module 602 configured to acquire the first parameter of the target device when the initialization operation is completed
  • the first sending module 604 is configured to send the first parameter to the H5 end to instruct the H5 end to adjust the parameters of the target component based on the first parameter, wherein the H5 end includes the target component,
  • the target device is configured to display operational information received through the target component.
  • the acquisition module 602 includes: a monitoring unit, configured to monitor the target device to obtain a notification message sent by the target device, wherein the notification message is the notification message sent by the target device when determining itself Sent after the parameter changes; the first obtaining unit is configured to obtain the first parameter included in the notification message; or, the receiving unit is configured to receive a parameter obtaining request from the H5 end; the second obtaining unit , set to acquire the first parameter of the target device based on the parameter acquisition request.
  • a monitoring unit configured to monitor the target device to obtain a notification message sent by the target device, wherein the notification message is the notification message sent by the target device when determining itself Sent after the parameter changes
  • the first obtaining unit is configured to obtain the first parameter included in the notification message
  • the receiving unit is configured to receive a parameter obtaining request from the H5 end
  • the second obtaining unit set to acquire the first parameter of the target device based on the parameter acquisition request.
  • the above device further includes: a second receiving module, configured to send the first parameter to the H5 end to instruct the H5 end to adjust the target component based on the first parameter
  • the operation data is the data obtained after the H5 terminal converts the operation behavior received by the target component
  • the second sending module is set to sending the operation data to the target device to instruct the target device to display the operation information based on the operation data, where the operation information includes a pattern corresponding to the operation behavior.
  • the above apparatus further includes: a third receiving module configured to, after sending the operation data to the target device, instruct the target device to display the operation information based on the operation data Afterwards, the display result returned by the target device is received, wherein the display result is used to indicate whether the target device has successfully displayed the operation information; a feedback module is configured to feed back to the H5 terminal based on the display result Respond to the message.
  • the above device further includes: a third sending module, configured to send the The target device sends a request instruction to request the target device to feed back the target information of the target device and request to perform a monitoring operation on the target device; the fourth receiving module is configured to receive the target fed back by the target device information to complete the initialization described.
  • FIG. 7 is a structural block diagram 2 of a parameter adjustment device according to an embodiment of the present disclosure. As shown in FIG. 7 , the device includes:
  • the first receiving module 702 is configured to receive the first parameter of the target device sent by the middleware;
  • An adjustment module 704 configured to adjust a parameter of a target component based on the first parameter, wherein the target device is configured to display the operation information received through the target component.
  • the above apparatus further includes: a fourth sending module, configured to send a parameter acquisition request to the middleware before receiving the first parameter of the target device sent by the middleware, so as to request the middleware The component acquires the first parameter of the target device.
  • a fourth sending module configured to send a parameter acquisition request to the middleware before receiving the first parameter of the target device sent by the middleware, so as to request the middleware The component acquires the first parameter of the target device.
  • the above device further includes: a fifth sending module, configured to send operation data to the middleware after adjusting the parameters of the target component based on the first parameters, to instruct the middleware sending the operation data to the target device and displaying operation information based on the operation data, wherein the operation data is data obtained by converting the operation behavior received by the target component, and the operation information The pattern corresponding to the operation behavior is included.
  • a fifth sending module configured to send operation data to the middleware after adjusting the parameters of the target component based on the first parameters, to instruct the middleware sending the operation data to the target device and displaying operation information based on the operation data, wherein the operation data is data obtained by converting the operation behavior received by the target component, and the operation information The pattern corresponding to the operation behavior is included.
  • the above apparatus further includes: a fifth receiving module, configured to, after sending operation data to the middleware to instruct the middleware to send the operation data to the target device, receiving a response message fed back by the middleware, wherein the response message is sent by the middleware when receiving a display result returned by the target device, and the display result is used to indicate whether the target device The described action message was successfully displayed.
  • a fifth receiving module configured to, after sending operation data to the middleware to instruct the middleware to send the operation data to the target device, receiving a response message fed back by the middleware, wherein the response message is sent by the middleware when receiving a display result returned by the target device, and the display result is used to indicate whether the target device The described action message was successfully displayed.
  • the above-mentioned apparatus further includes: a sixth sending module, configured to send an invocation instruction to the middleware before receiving the first parameter of the target device sent by the middleware, to instruct the middleware to Executing a predetermined operation, wherein the predetermined operation includes: sending a request instruction to the target device to request the target device to feed back the target information of the target device and request to perform a monitoring operation on the target device; receiving the target The target information fed back by the device to complete the initialization operation.
  • a sixth sending module configured to send an invocation instruction to the middleware before receiving the first parameter of the target device sent by the middleware, to instruct the middleware to Executing a predetermined operation, wherein the predetermined operation includes: sending a request instruction to the target device to request the target device to feed back the target information of the target device and request to perform a monitoring operation on the target device; receiving the target The target information fed back by the device to complete the initialization operation.
  • the above-mentioned modules can be realized by software or hardware. For the latter, it can be realized by the following methods, but not limited to this: the above-mentioned modules are all located in the same processor; or, the above-mentioned modules can be combined in any combination The forms of are located in different processors.
  • Embodiments of the present disclosure also provide a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps in any one of the above method embodiments when running.
  • the above-mentioned computer-readable storage medium may include but not limited to: U disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM) , mobile hard disk, magnetic disk or optical disk and other media that can store computer programs.
  • ROM read-only memory
  • RAM random access memory
  • mobile hard disk magnetic disk or optical disk and other media that can store computer programs.
  • the electronic device for implementing the above parameter adjustment method.
  • the electronic device includes a memory 802 and a processor 804, and the memory 802 stores a program, the processor 804 is configured to execute the steps in any one of the above method embodiments through a computer program.
  • the foregoing electronic device may be located in at least one network device among multiple network devices of the computer network.
  • the above-mentioned processor may be configured to execute the following steps through a computer program:
  • the above-mentioned processor may also be configured to execute the following steps through a computer program:
  • FIG. 8 is only schematic, and the electronic device can also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, and a mobile Internet device ( Mobile Internet Devices, MID), PAD and other terminal equipment.
  • FIG. 8 does not limit the structure of the above-mentioned electronic device.
  • the electronic device may also include more or less components than those shown in FIG. 8 (such as a network interface, etc.), or have a different configuration from that shown in FIG. 8 .
  • the memory 802 can be set to store software programs and modules, such as program instructions/modules corresponding to the semantic transformation method and device in the embodiments of the present disclosure, and the processor 804 runs the software programs and modules stored in the memory 802 to execute Various functional applications and data processing are to realize the above-mentioned semantic transformation method.
  • the memory 802 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
  • the memory 802 may further include a memory that is remotely located relative to the processor 804, and these remote memories may be connected to the terminal through a network.
  • the memory 802 may include, but is not limited to, the first acquisition module 802 , the first determination module 804 , the analysis module 806 and the second determination module 808 in the semantic conversion device. In addition, it may also include but not limited to other module units in the above-mentioned identity determination device, which will not be described in detail in this example.
  • the above-mentioned transmission device 806 is configured to receive or send data via a network.
  • the specific examples of the above-mentioned network may include a wired network and a wireless network.
  • the transmission device 806 includes a network adapter (Network Interface Controller, NIC), which can be connected with other network devices and a router through a network cable so as to communicate with the Internet or a local area network.
  • the transmission device 806 is a radio frequency (Radio Frequency, RF) module, which is configured to communicate with the Internet in a wireless manner.
  • RF Radio Frequency
  • the above-mentioned electronic device further includes: a display 808 configured to display the above-mentioned second control instruction; and a connection bus 810 configured to connect various module components in the above-mentioned electronic device.
  • each module or each step of the above-mentioned disclosure can be realized by a general-purpose computing device, and they can be concentrated on a single computing device, or distributed in a network composed of multiple computing devices In fact, they can be implemented in program code executable by a computing device, and thus, they can be stored in a storage device to be executed by a computing device, and in some cases, can be executed in an order different from that shown here. Or described steps, or they are fabricated into individual integrated circuit modules, or multiple modules or steps among them are fabricated into a single integrated circuit module for implementation. As such, the present disclosure is not limited to any specific combination of hardware and software.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

本公开实施例提供了一种参数调整方法、装置、存储介质及电子装置,其中,该方法包括:在完成初始化操作的情况下,获取目标设备的第一参数;将第一参数发送给H5端,以指示H5端基于第一参数调整目标组件的参数,其中,H5端中包括目标组件,目标设备设置为显示通过目标组件所接收到的操作信息。

Description

参数调整方法、装置、存储介质及电子装置
本公开要求于2021年10月25日提交中国专利局、申请号为202111243760.1、发明名称为“参数调整方法、装置、存储介质及电子装置”的中国专利申请的优先权,其全部内容通过引用结合在本公开中。
技术领域
本公开实施例涉及计算机技术领域,具体而言,涉及一种参数调整方法、装置、存储介质及电子装置。
背景技术
Canvas是HTML5(以下简称H5)新增的组件,它就像一块幕布,可以用JavaScript在上面绘制各种图表、动画等。没有Canvas的年代,绘图只能借助Flash插件实现,页面不得不用JavaScript和Flash进行交互,有了Canvas,我们就再也不需要Flash了,直接使用JavaScript完成绘制。但是,HTML5的Canvas在每平方英寸有更多像素的高每英寸点数DPI(Dots Per Inch)设备上,比如手机,平板电脑,当然也包括很多高分辨率高DPI的高端台式电脑显示器,绘制字体、图片与图形会变的模糊,例如,用户自行设置使得显示设备的参数发生变化,或者从一个高DPI显示器移动窗口到低DPI显示器时,或浏览器的DPI发生变化时,H5端绘制出的字体、图片或图形可能会变得模糊,即相关技术中存在着H5端有时无法绘制出清晰的图。因此,如何使H5端在任何情况下都能绘制清晰的图就称为当前亟需解决的问题。
针对现有技术中存在的H5端绘制清晰图的成功率不高的问题,目前尚未提出有效的解决方案。
发明内容
本公开实施例提供了一种参数调整方法、装置、存储介质及电子装置,以至少解决相关技术中存在的H5端绘制清晰图的成功率不高的问题。
根据本公开的一个实施例,提供了一种参数调整方法,包括:在完成初始化操作的情况下,获取目标设备的第一参数;将所述第一参数发送给H5端,以指示所述H5端基于所述第一参数调整目标组件的参数,其中,所述H5端中包括所述目标组件,所述目标设备设置为显示通过所述目标组件所接收到的操作信息。
根据本公开的另一个实施例,还提供了一种参数调整方法,包括:接收中间件发送的目标设备的第一参数;基于所述第一参数调整目标组件的参数,其中,所述目标设备设置为显示通过所述目标组件所接收到的操作信息。
根据本公开的又一个实施例,还提供了一种参数调整装置,包括:获取模块,设置为在完成初始化操作的情况下,获取目标设备的第一参数;第一发送模块,设置为将所述第一参数发送给H5端,以指示所述H5端基于所述第一参数调整目标组件的参数,其中,所述H5端中包括所述目标组件,所述目标设备设置为显示通过所述目标组件所接收到的操作信息。
根据本公开的又一个实施例,还提供了一种参数调整装置,包括:第一接收模块,设置为接收中间件发送的目标设备的第一参数;调整模块,设置为基于所述第一参数调整目标组件的参数,其中,所述目标设备设置为显示通过所述目标组件所接收到的操作信息。
根据本公开的又一个实施例,还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。
根据本公开的又一个实施例,还提供了一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行上述任一项方法实施例中的步骤。
附图说明
图1是本公开实施例的参数调整方法的移动终端的硬件结构框图;
图2是根据本公开实施例的参数调整方法的流程图一;
图3是根据本公开实施例的参数调整方法的流程图二;
图4是根据本公开具体实施例的参数调整方法的流程图;
图5是根据本公开具体实施例系统框架图;
图6是根据本公开实施例的参数调整装置的结构框图一;
图7是根据本公开实施例的参数调整装置的结构框图二;
图8是根据本公开实施例的电子装置的结构框图。
具体实施方式
下文中将参考附图并结合实施例来详细说明本公开的实施例。
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
本申请实施例中所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在移动终端上为例,图1是本公开实施例的参数调整方法的移动终端的硬件结构框图。如图1所示,移动终端可以包括一个或多个(图1中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)和设置为存储数据的存储器104,其中,上述移动终端还可以包括设置为通信功能的传输设备106以及输入输出设备108。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述移动终端的结构造成限定。例如,移动终端还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。
存储器104可设置为存储计算机程序,例如,应用软件的软件程序以及模块,如本公开实施例中的参数调整方法对应的计算机程序,处理器102通过运行存储在存储器104内的计算机程序,从而执行各种功能应用以及 数据处理,即实现上述的方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至移动终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
传输装置106设置为经由一个网络接收或者发送数据。上述的网络具体实例可包括移动终端的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,简称为NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,简称为RF)模块,其设置为通过无线方式与互联网进行通讯。
在本实施例中提供了一种参数调整方法,图2是根据本公开实施例的参数调整方法的流程图一,如图2所示,该流程包括如下步骤:
步骤S202,在完成初始化操作的情况下,获取目标设备的第一参数;
步骤S204,将所述第一参数发送给H5端,以指示所述H5端基于所述第一参数调整目标组件的参数,其中,所述H5端中包括所述目标组件,所述目标设备设置为显示通过所述目标组件所接收到的操作信息。
通过上述步骤,通过获取目标设备的第一参数,并将第一参数发送给H5端,使得H5端可基于该第一参数调整H5端中的目标组件的参数,可使得目标组件的参数与目标设备的第一参数匹配的目的,进而可以使得目标设备能够清晰地显示目标组件上所接收到的操作信息。实现了基于目标设备的第一参数对H5端中的目标组件的参数进行调整,以达到与目标设备的第一参数相匹配的目的,解决了相关技术中存在的H5端绘制清晰图的成功率不高的问题,进而达到了提高H5端绘制清晰图的成功率的效果。
其中,上述步骤的执行主体可以为后台处理器,或H5容器,或H5端组件,例如,H5端与原生侧之间的中间件,或者终端,或者为配置在 存储设备上的具备人机交互能力的处理器,或者为具备类似处理能力的处理设备或处理单元等,但不限于此。下面以H5端与原生侧之间的中间件(以下简称为“中间件”)执行上述操作为例(仅是一种示例性说明,在实际操作中还可以是其他的设备或模块来执行上述操作)进行说明:
在上述实施例中,中间件在完成初始化操作的情况下,获取目标设备的第一参数,目标设备可以是显示器,平板电脑,手机,或其它显示设备等,在实际应用中,中间件可向目标设备发送请求,以请求获取目标设备的第一参数,例如,第一参数可以包括目标设备的像素,分辨率,DPI,或其它设备端的信息,再将第一参数发送给H5端,以指示H5端基于该第一参数调整目标组件的参数,例如,目标组件可以是H5端的Canvas,即指示H5端调整Canvas的参数,例如,调整Canvas的宽、高、缩放比等参数,在实际应用中,将Canvas的参数调整为与目标设备的第一参数相匹配,这样目标设备能够清晰地显示目标组件上所接收到的操作信息,例如,H5端用JavaScript在Canvas上面绘制各种图表、字体、图片或动画等,在基于目标设备的第一参数对目标组件(如Canvas)的参数进行调整后,目标设备上可以清晰地显示图片、图标或动画等。同时,在实际应用中,可由中间件监听目标设备端的信息(如上述第一参数),当目标设备端的信息发生变化时,能够动态地调整目标组件(如Canvas)的参数,解决了相关技术中存在的H5端绘制清晰图的成功率不高的问题,进而达到了提高H5端绘制清晰图的成功率的效果。
在一个可选的实施例中,获取所述目标设备的第一参数包括:监听所述目标设备以获取所述目标设备发送的通知消息,其中,所述通知消息为所述目标设备在确定自身参数发生变化后所发送的;获取所述通知消息中包括的所述第一参数;或者,接收来自所述H5端的参数获取请求;基于所述参数获取请求获取所述目标设备的所述第一参数。在本实施例中,中间件可监听获取目标设备端的信息,当目标设备端的信息发生变化时会向中间件发送实时更新的通知消息,中间件接收到通知消息,即可获取通知消息中包括的第一参数,需要说明的是,在实际应用中,中间件在初始化 过程中会向目标设备端发出请求,以请求获取目标设备端的详细信息,并完成中间件监听的订阅;或者,中间件可接收来自H5端的参数获取请求,例如,请求设备属性接口,以请求获取目标设备的第一参数。通过本实施例,可以实现由中间件对目标设备进行监听以获取目标设备的实时的参数信息的目的,同时也可以通过请求设备属性接口获取目标设备的第一参数。
在一个可选的实施例中,在将所述第一参数发送给所述H5端,以指示所述H5端基于所述第一参数调整目标组件的参数之后,所述方法还包括:接收所述H5端发送的操作数据,其中,所述操作数据为所述H5端对通过所述目标组件所接收的操作行为进行转换后得到的数据;将所述操作数据发送至所述目标设备,以指示所述目标设备基于所述操作数据显示所述操作信息,其中,所述操作信息包括所述操作行为所对应的图样。在本实施例中,中间件可接收H5端发送的操作数据,例如,用户在H5侧对设备进行交互操作后,H5侧将用户的操作行为转换为操作数据并发送给中间件,然后,中间件将操作数据发送至目标设备,这样目标设备可基于操作数据显示操作信息,例如,用户在H5端绘制图形、字体、图片或动画等操作行为,目标设备可基于操作数据显示与操作行为对应的图样。通过本实施例,实现了在调整目标组件的参数之后将目标组件所接收的操作行为在目标设备进行显示的目的。
在一个可选的实施例中,在将所述操作数据发送至所述目标设备,以指示所述目标设备基于所述操作数据显示所述操作信息之后,所述方法还包括:接收所述目标设备返回的显示结果,其中,所述显示结果用于指示所述目标设备是否已成功显示所述操作信息;基于所述显示结果向所述H5端反馈响应消息。在本实施例中,在将操作数据发送给目标设备并指示目标设备显示操作信息之后,中间件接收目标设备返回的显示结果,显示结果用于指示目标设备是否显示成功,并基于显示结果向H5端反馈响应消息。通过本实施例,实现了基于目标设备的显示结果进行反馈的目的。
在一个可选的实施例中,在获取所述目标设备的第一参数之前,所述 方法还包括:在接收到所述H5端发送的调用指令的情况下,向所述目标设备发出请求指令,以请求所述目标设备反馈所述目标设备的目标信息及请求对所述目标设备执行监听操作;接收所述目标设备反馈的所述目标信息,以完成所述初始化操作。在实际应用中,在获取目标设备的第一参数之前,中间件需完成初始化操作,例如,在接收到H5端发送的调用指令的情况下,中间件会向目标设备发出请求,目标设备端收到请求后会反馈给中间件当前目标设备的详细信息,例如,详细信息包括目标设备的像素,分辨率,DPI等参数信息,并且完成中间件监听的订阅,中间件收到目标设备返回的详细信息后,即完成初始化操作。通过本实施例,实现了对中间件进行初始化操作的目的。
在本实施例中还提供了一种参数调整方法,图3是根据本公开实施例的参数调整方法的流程图二,如图3所示,该流程包括如下步骤:
步骤S302,接收中间件发送的目标设备的第一参数;
步骤S304,基于所述第一参数调整目标组件的参数,其中,所述目标设备设置为显示通过所述目标组件所接收到的操作信息。
通过上述步骤,通过接收中间件发送的目标设备的第一参数,并基于该第一参数调整目标组件的参数,可以使得目标组件的参数与目标设备的第一参数匹配的目的,进而可以使得目标设备能够清晰地显示目标组件上所接收到的操作信息。实现了基于目标设备的第一参数对目标组件的参数进行调整,以达到与目标设备的第一参数相匹配的目的,解决了相关技术中存在的H5端绘制清晰图的成功率不高的问题,进而达到了提高H5端绘制清晰图的成功率的效果。
其中,上述步骤的执行主体可以为H5端,或终端,或网页端,或者为配置在存储设备上的具备人机交互能力的处理器,或者为具备类似处理能力的处理设备或处理单元等,但不限于此。下面以H5端执行上述操作为例(仅是一种示例性说明,在实际操作中还可以是其他的设备或模块来执行上述操作)进行说明:
在上述实施例中,H5端接收中间件发送的目标设备的第一参数,目标设备可以是显示器,平板电脑,手机,或其它显示设备等,在实际应用中,中间件可向目标设备发送请求,以请求获取目标设备的第一参数,例如,第一参数可以包括目标设备的像素,分辨率,DPI,或其它设备端的信息,再将第一参数发送给H5端,然后H5端可基于该第一参数调整目标组件的参数,例如,目标组件可以是H5端的Canvas,即指示H5端调整Canvas的参数,例如,调整Canvas的宽、高、缩放比等参数,在实际应用中,将Canvas的参数调整为与目标设备的第一参数相匹配,这样目标设备能够清晰地显示目标组件上所接收到的操作信息,例如,H5端用JavaScript在Canvas上面绘制各种图表、字体、图片或动画等,在基于目标设备的第一参数对目标组件(如Canvas)的参数进行调整后,目标设备上可以清晰地显示图片、图标或动画等。在实际应用中,H5端可先向中间件发出请求,例如,请求设备属性接口,以请求获取目标设备的实时的参数信息,还可以由中间件监听目标设备端的信息(如上述第一参数),当目标设备端的信息发生变化时,能够将变化后的第一参数发送给H5端,这样H5端能够动态地调整目标组件(如Canvas)的参数,解决了相关技术中存在的H5端绘制清晰图的成功率不高的问题,进而达到了提高H5端绘制清晰图的成功率的效果。
在一个可选的实施例中,在接收中间件发送的目标设备的第一参数之前,所述方法还包括:向所述中间件发出参数获取请求,以请求所述中间件获取所述目标设备的所述第一参数。在本实施例中,可通过向中间件发送参数获取请求,以请求获取目标设备的第一参数,例如,请求设备属性接口,以请求获取目标设备的参数信息,如上述第一参数。通过本实施例,可实现通过发送请求设备属性接口的方式以请求获取目标设备的参数的目的。
在一个可选的实施例中,在基于所述第一参数调整目标组件的参数之后,所述方法还包括:向所述中间件发送操作数据,以指示所述中间件将所述操作数据发送至所述目标设备并基于所述操作数据显示操作信息,其 中,所述操作数据为通过对所述目标组件所接收的操作行为进行转换后得到的数据,所述操作信息包括所述操作行为所对应的图样。在本实施例中,H5端向中间件发送操作数据,例如,用户在H5侧对设备进行交互操作后,H5侧将用户的操作行为转换为操作数据并发送给中间件,并指示中间件将操作数据发送至目标设备,这样目标设备可基于操作数据显示操作信息,例如,用户在H5端绘制图形、字体、图片或动画等操作行为,目标设备可基于操作数据显示与操作行为对应的图样。通过本实施例,实现了在调整目标组件的参数之后将目标组件所接收的操作行为在目标设备进行显示的目的。
在一个可选的实施例中,在向所述中间件发送操作数据,以指示所述中间件将所述操作数据发送至所述目标设备之后,所述方法还包括:接收所述中间件反馈的响应消息,其中,所述响应消息是所述中间件在接收到所述目标设备返回显示结果的情况下所发送的,所述显示结果用于指示所述目标设备是否已成功显示所述操作信息。在本实施例中,在将目标数据发送给目标设备并在目标设备显示操作信息后,目标H5端会接收到中间件反馈的响应消息,例如,在目标设备显示结果之后,通过中间件反馈给H5侧成功的信息。通过本实施例,实现了基于目标设备的显示结果进行反馈的目的。
在一个可选的实施例中,在接收中间件发送的目标设备的第一参数之前,所述方法还包括:向所述中间件发出调用指令,以指示所述中间件执行预定操作,其中,所述预定操作包括:向所述目标设备发出请求指令,以请求所述目标设备反馈所述目标设备的目标信息及请求对所述目标设备执行监听操作;接收所述目标设备反馈的所述目标信息,以完成初始化操作。在本实施例中,H5端在接收中间件发送的第一参数之前,向中间件发出调用指令,例如,调用中间件的初始化API接口,中间件的初始化API接口被触发后,会向目标设备发出请求,目标设备端收到请求后会反馈给中间件当前目标设备的详细信息,并且完成中间件监听的订阅,中间件收到目标设备返回的详细信息后,即完成初始化操作。通过本实施例, 实现了对中间件进行调用以使中间件执行初始化操作的目的。
显然,上述所描述的实施例仅仅是本公开一部分的实施例,而不是全部的实施例。
下面结合实施例对本公开进行具体说明:
图4是根据本公开具体实施例的参数调整方法的流程图,如图4所示,该流程包括如下步骤:
S402,H5侧(对应于前述H5端)调用中间件初始化API,H5侧项目首先引入中间件,项目在初始化成功后,调用中间件的初始化API接口;
S404,中间件请求初始化资源,中间件的初始化API接口被触发后,会向高dpi设备(对应于前述目标设备,例如,手机,浏览器,外接显示器等)端发送请求;
S406,高dpi设备反馈资源,高dpi设备端收到请求,会反馈给中间件当前高dpi设备的详细信息(对应于前述目标信息),并且完成中间件监听的订阅;
S408,初始化成功,中间件收到高dpi设备返回的详细信息后,中间件初始化成功;
S410,H5侧获取设备属性接口,中间件初始化成功后,H5侧可以发送请求(对应于前述参数获取请求)设备属性接口,获取高dpi设备端的信息;
S412,中间件初始化成功后,中间件监听设备变化,通过中间件的监听获取高dpi设备端的信息;
S414,高dpi设备返回设备数据,例如,高dpi设备端发生变化的时候会向中间件发送实时更新的通知;
S416,中间件返回数据给前端,中间件收到通知,可以向H5侧推送高dpi设备端通知里的信息,通知消息里包括高dpi设备变化后的参数(对应于前述第一参数);
S418,H5侧向中间件下发数据,例如,用户在H5侧对设备进行交互操作后,H5侧将用户的操作行为转换为数据,使用中间件的API接口下发数据;
S420,调用接口发送数据,中间件调用接口将上述操作行为对应的数据发送给高dpi设备;
S422,高dpi设备返回数据结果,高dpi设备端收到数据会实时记录;
S424,中间件返回请求的数据,高dpi设备通过中间件反馈给H5侧成功的信息。
在上述步骤中,H5在项目里依赖中间件,中间件随着H5项目初始化,暴露出API接口给H5;H5侧使用中间件暴露出的API接口获取高dpi设备侧的数据;中间件可以监听高dpi设备侧,可以根据设备的dpi动态的调整canvas的宽高和缩放比;用户在H5侧进行设备操作后,可以通过中间件将操作数据传递给高dpi设备侧,高dpi设备侧实时更新当前最新的数据。
需要说明的是,上述步骤S410作为一种可选的方式以获取高dpi设备的参数,但该步骤不是必须的,可以通过步骤S412中的中间件监听设备变化以获取高dpi设备端的实时变化的参数信息。
通过上述实施例,在浏览器的dpi发生变化时,比如用户设置,或者从一个高dpi显示器移动窗口到低dpi显示器时发生,能实时监听到变化,并返回当前最新的设备显示器参数和配置,通过参数做出相应的动态调整,此外,中间件对高dpi设备端返回的数据统一处理,同一接口在不同环境下,以达到返回的数据格式是一致的效果。
图5是根据本公开具体实施例系统框架图,如图5所示,该系统包括:H5容器502、高dpi设备504、数据库506,其中,H5容器502中包括:H5侧5022、中间件5024;
数据源是从server的数据库506中获取,H5侧和中间件都依赖h5容器才能运行,H5侧不直接和高dpi设备进行数据交互,数据通过中间件进 行中转流通,这样可以由中间件去消除不同系统和容器带来的差异性问题;高dpi设备侧和server进行数据交互,可以避免数据来源混乱情况。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本公开各个实施例所述的方法。
在本实施例中还提供了一种参数调整装置,图6是根据本公开实施例的参数调整装置的结构框图一,如图6所示,该装置包括:
获取模块602,设置为在完成初始化操作的情况下,获取目标设备的第一参数;
第一发送模块604,设置为将所述第一参数发送给H5端,以指示所述H5端基于所述第一参数调整目标组件的参数,其中,所述H5端中包括所述目标组件,所述目标设备设置为显示通过所述目标组件所接收到的操作信息。
在一个可选的实施例中,上述获取模块602包括:监听单元,设置为监听所述目标设备以获取所述目标设备发送的通知消息,其中,所述通知消息为所述目标设备在确定自身参数发生变化后所发送的;第一获取单元,设置为获取所述通知消息中包括的所述第一参数;或者,接收单元,设置为接收来自所述H5端的参数获取请求;第二获取单元,设置为基于所述参数获取请求获取所述目标设备的所述第一参数。
在一个可选的实施例中,上述装置还包括:第二接收模块,设置为在将所述第一参数发送给所述H5端,以指示所述H5端基于所述第一参数调整目标组件的参数之后,接收所述H5端发送的操作数据,其中,所述 操作数据为所述H5端对通过所述目标组件所接收的操作行为进行转换后得到的数据;第二发送模块,设置为将所述操作数据发送至所述目标设备,以指示所述目标设备基于所述操作数据显示所述操作信息,其中,所述操作信息包括所述操作行为所对应的图样。
在一个可选的实施例中,上述装置还包括:第三接收模块,设置为在将所述操作数据发送至所述目标设备,以指示所述目标设备基于所述操作数据显示所述操作信息之后,接收所述目标设备返回的显示结果,其中,所述显示结果用于指示所述目标设备是否已成功显示所述操作信息;反馈模块,设置为基于所述显示结果向所述H5端反馈响应消息。
在一个可选的实施例中,上述装置还包括:第三发送模块,设置为在获取所述目标设备的第一参数之前,且在接收到所述H5端发送的调用指令的情况下,向所述目标设备发出请求指令,以请求所述目标设备反馈所述目标设备的目标信息及请求对所述目标设备执行监听操作;第四接收模块,设置为接收所述目标设备反馈的所述目标信息,以完成所述初始化操作。
在本实施例中还提供了一种参数调整装置,图7是根据本公开实施例的参数调整装置的结构框图二,如图7所示,该装置包括:
第一接收模块702,设置为接收中间件发送的目标设备的第一参数;
调整模块704,设置为基于所述第一参数调整目标组件的参数,其中,所述目标设备设置为显示通过所述目标组件所接收到的操作信息。
在一个可选的实施例中,上述装置还包括:第四发送模块,设置为在接收中间件发送的目标设备的第一参数之前,向所述中间件发出参数获取请求,以请求所述中间件获取所述目标设备的所述第一参数。
在一个可选的实施例中,上述装置还包括:第五发送模块,设置为在基于所述第一参数调整目标组件的参数之后,向所述中间件发送操作数据,以指示所述中间件将所述操作数据发送至所述目标设备并基于所述操作数据显示操作信息,其中,所述操作数据为通过对所述目标组件所接收 的操作行为进行转换后得到的数据,所述操作信息包括所述操作行为所对应的图样。
在一个可选的实施例中,上述装置还包括:第五接收模块,设置为在向所述中间件发送操作数据,以指示所述中间件将所述操作数据发送至所述目标设备之后,接收所述中间件反馈的响应消息,其中,所述响应消息是所述中间件在接收到所述目标设备返回显示结果的情况下所发送的,所述显示结果用于指示所述目标设备是否已成功显示所述操作信息。
在一个可选的实施例中,上述装置还包括:第六发送模块,设置为在接收中间件发送的目标设备的第一参数之前,向所述中间件发出调用指令,以指示所述中间件执行预定操作,其中,所述预定操作包括:向所述目标设备发出请求指令,以请求所述目标设备反馈所述目标设备的目标信息及请求对所述目标设备执行监听操作;接收所述目标设备反馈的所述目标信息,以完成初始化操作。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。
本公开的实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。
在一个示例性实施例中,上述计算机可读存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。
根据本公开实施例的又一个方面,还提供了一种用于实施上述参数调整方法的电子装置,如图8所示,该电子装置包括存储器802和处理器804,该存储器802中存储有计算机程序,该处理器804被设置为通过计算机程序执行上述任一项方法实施例中的步骤。
可选地,在本实施例中,上述电子装置可以位于计算机网络的多个网络设备中的至少一个网络设备。
可选地,在本实施例中,上述处理器可以被设置为通过计算机程序执行以下步骤:
S1,在完成初始化操作的情况下,获取目标设备的第一参数;
S2,将所述第一参数发送给H5端,以指示所述H5端基于所述第一参数调整目标组件的参数,其中,所述H5端中包括所述目标组件,所述目标设备设置为显示通过所述目标组件所接收到的操作信息。
可选地,在本实施例中,上述处理器还可以被设置为通过计算机程序执行以下步骤:
S1,接收中间件发送的目标设备的第一参数;
S2,基于所述第一参数调整目标组件的参数,其中,所述目标设备设置为显示通过所述目标组件所接收到的操作信息。
可选地,本领域普通技术人员可以理解,图,8所示的结构仅为示意,电子装置也可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌上电脑以及移动互联网设备(Mobile Internet Devices,MID)、PAD等终端设备。图8其并不对上述电子装置的结构造成限定。例如,电子装置还可包括比图8中所示更多或者更少的组件(如网络接口等),或者具有与图8所示不同的配置。
其中,存储器802可设置为存储软件程序以及模块,如本公开实施例中的语义转换方法和装置对应的程序指令/模块,处理器804通过运行存储在存储器802内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的语义转换方法。存储器802可包括高速随机存储器,还可以包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器802可进一步包括相对于 处理器804远程设置的存储器,这些远程存储器可以通过网络连接至终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。作为一种示例,如图8所示,上述存储器802中可以但不限于包括上述语义转换装置中的第一获取模块802、第一确定模块804、分析模块806和第二确定模块808。此外,还可以包括但不限于上述身份确定装置中的其他模块单元,本示例中不再赘述。
可选地,上述的传输装置806设置为经由一个网络接收或者发送数据。上述的网络具体实例可包括有线网络及无线网络。在一个实例中,传输装置806包括一个网络适配器(Network Interface Controller,NIC),其可通过网线与其他网络设备与路由器相连从而可与互联网或局域网进行通讯。在一个实例中,传输装置806为射频(Radio Frequency,RF)模块,其设置为通过无线方式与互联网进行通讯。
此外,上述电子装置还包括:显示器808,设置为显示上述第二控制指令;和连接总线810,设置为连接上述电子装置中的各个模块部件。
本实施例中的具体示例可以参考上述实施例及示例性实施方式中所描述的示例,本实施例在此不再赘述。
显然,本领域的技术人员应该明白,上述的本公开的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本公开不限制于任何特定的硬件和软件结合。
以上所述仅为本公开的优选实施例而已,并不用于限制本公开,对于本领域的技术人员来说,本公开可以有各种更改和变化。凡在本公开的原则之内,所作的任何修改、等同替换、改进等,均应包含在本公开的保护 范围之内。

Claims (22)

  1. 一种参数调整方法,包括:
    在完成初始化操作的情况下,获取目标设备的第一参数;
    将所述第一参数发送给H5端,以指示所述H5端基于所述第一参数调整目标组件的参数,其中,所述H5端中包括所述目标组件,所述目标设备设置为显示通过所述目标组件所接收到的操作信息。
  2. 根据权利要求1所述的方法,其中,获取所述目标设备的第一参数包括:
    监听所述目标设备以获取所述目标设备发送的通知消息,其中,所述通知消息为所述目标设备在确定自身参数发生变化后所发送的;获取所述通知消息中包括的所述第一参数;
    或者,
    接收来自所述H5端的参数获取请求;基于所述参数获取请求获取所述目标设备的所述第一参数。
  3. 根据权利要求1所述的方法,其中,在将所述第一参数发送给所述H5端,以指示所述H5端基于所述第一参数调整目标组件的参数之后,所述方法还包括:
    接收所述H5端发送的操作数据,其中,所述操作数据为所述H5端对通过所述目标组件所接收的操作行为进行转换后得到的数据;
    将所述操作数据发送至所述目标设备,以指示所述目标设备基于所述操作数据显示所述操作信息,其中,所述操作信息包括所述操作行为所对应的图样。
  4. 根据权利要求3所述的方法,其中,在将所述操作数据发送至所述目标设备,以指示所述目标设备基于所述操作数据显示所述操作信息之后,所述方法还包括:
    接收所述目标设备返回的显示结果,其中,所述显示结果用于指 示所述目标设备是否已成功显示所述操作信息;
    基于所述显示结果向所述H5端反馈响应消息。
  5. 根据权利要求1所述的方法,其中,在获取所述目标设备的第一参数之前,所述方法还包括:
    在接收到所述H5端发送的调用指令的情况下,向所述目标设备发出请求指令,以请求所述目标设备反馈所述目标设备的目标信息及请求对所述目标设备执行监听操作;
    接收所述目标设备反馈的所述目标信息,以完成所述初始化操作。
  6. 一种参数调整方法,包括:
    接收中间件发送的目标设备的第一参数;
    基于所述第一参数调整目标组件的参数,其中,所述目标设备设置为显示通过所述目标组件所接收到的操作信息。
  7. 根据权利要求6所述的方法,其中,在接收中间件发送的目标设备的第一参数之前,所述方法还包括:
    向所述中间件发出参数获取请求,以请求所述中间件获取所述目标设备的所述第一参数。
  8. 根据权利要求6所述的方法,其中,在基于所述第一参数调整目标组件的参数之后,所述方法还包括:
    向所述中间件发送操作数据,以指示所述中间件将所述操作数据发送至所述目标设备并基于所述操作数据显示操作信息,其中,所述操作数据为通过对所述目标组件所接收的操作行为进行转换后得到的数据,所述操作信息包括所述操作行为所对应的图样。
  9. 根据权利要求8所述的方法,其中,在向所述中间件发送操作数据,以指示所述中间件将所述操作数据发送至所述目标设备之后,所述方法还包括:
    接收所述中间件反馈的响应消息,其中,所述响应消息是所述中间件在接收到所述目标设备返回显示结果的情况下所发送的,所述显示结果用于指示所述目标设备是否已成功显示所述操作信息。
  10. 根据权利要求6所述的方法,其中,在接收中间件发送的目标设备的第一参数之前,所述方法还包括:
    向所述中间件发出调用指令,以指示所述中间件执行预定操作,其中,所述预定操作包括:向所述目标设备发出请求指令,以请求所述目标设备反馈所述目标设备的目标信息及请求对所述目标设备执行监听操作;接收所述目标设备反馈的所述目标信息,以完成初始化操作。
  11. 一种参数调整装置,包括:
    获取模块,设置为在完成初始化操作的情况下,获取目标设备的第一参数;
    第一发送模块,设置为将所述第一参数发送给H5端,以指示所述H5端基于所述第一参数调整目标组件的参数,其中,所述H5端中包括所述目标组件,所述目标设备设置为显示通过所述目标组件所接收到的操作信息。
  12. 根据权利要求11所述的装置,其中,所述获取模块包括:
    监听单元,设置为监听所述目标设备以获取所述目标设备发送的通知消息,其中,所述通知消息为所述目标设备在确定自身参数发生变化后所发送的;第一获取单元,设置为获取所述通知消息中包括的所述第一参数;
    或者,
    接收单元,设置为接收来自所述H5端的参数获取请求;第二获取单元,设置为基于所述参数获取请求获取所述目标设备的所述第一参数。
  13. 根据权利要求11所述的装置,其中,所述装置还包括:
    第二接收模块,设置为在将所述第一参数发送给所述H5端,以指示所述H5端基于所述第一参数调整目标组件的参数之后,接收所述H5端发送的操作数据,其中,所述操作数据为所述H5端对通过所述目标组件所接收的操作行为进行转换后得到的数据;
    第二发送模块,设置为将所述操作数据发送至所述目标设备,以指示所述目标设备基于所述操作数据显示所述操作信息,其中,所述操作信息包括所述操作行为所对应的图样。
  14. 根据权利要求13所述的装置,其中,所述装置还包括:
    第三接收模块,设置为在将所述操作数据发送至所述目标设备,以指示所述目标设备基于所述操作数据显示所述操作信息之后,接收所述目标设备返回的显示结果,其中,所述显示结果用于指示所述目标设备是否已成功显示所述操作信息;
    反馈模块,设置为基于所述显示结果向所述H5端反馈响应消息。
  15. 根据权利要求11所述的装置,其中,所述装置还包括:
    第三发送模块,设置为在获取所述目标设备的第一参数之前,且在接收到所述H5端发送的调用指令的情况下,向所述目标设备发出请求指令,以请求所述目标设备反馈所述目标设备的目标信息及请求对所述目标设备执行监听操作;
    第四接收模块,设置为接收所述目标设备反馈的所述目标信息,以完成所述初始化操作。
  16. 一种参数调整装置,包括:
    第一接收模块,设置为接收中间件发送的目标设备的第一参数;
    调整模块,设置为基于所述第一参数调整目标组件的参数,其中,所述目标设备设置为显示通过所述目标组件所接收到的操作信息。
  17. 根据权利要求16所述的装置,其中,所述装置还包括:
    第四发送模块,设置为在接收中间件发送的目标设备的第一参数之前,向所述中间件发出参数获取请求,以请求所述中间件获取所述目标设备的所述第一参数。
  18. 根据权利要求16所述的装置,其中,所述装置还包括:
    第五发送模块,设置为在基于所述第一参数调整目标组件的参数之后,向所述中间件发送操作数据,以指示所述中间件将所述操作数据发送至所述目标设备并基于所述操作数据显示操作信息,其中,所述操作数据为通过对所述目标组件所接收的操作行为进行转换后得到的数据,所述操作信息包括所述操作行为所对应的图样。
  19. 根据权利要求18所述的装置,其中,所述装置还包括:
    第五接收模块,设置为在向所述中间件发送操作数据,以指示所述中间件将所述操作数据发送至所述目标设备之后,接收所述中间件反馈的响应消息,其中,所述响应消息是所述中间件在接收到所述目标设备返回显示结果的情况下所发送的,所述显示结果用于指示所述目标设备是否已成功显示所述操作信息。
  20. 根据权利要求16所述的装置,其中,所述装置还包括:
    第六发送模块,设置为在接收中间件发送的目标设备的第一参数之前,向所述中间件发出调用指令,以指示所述中间件执行预定操作,其中,所述预定操作包括:向所述目标设备发出请求指令,以请求所述目标设备反馈所述目标设备的目标信息及请求对所述目标设备执行监听操作;接收所述目标设备反馈的所述目标信息,以完成初始化操作。
  21. 一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,其中,所述计算机程序被处理器执行时实现所述权利要求1至5或6至10任一项中所述的方法的步骤。
  22. 一种电子装置,包括存储器和处理器,其中,所述存储器中 存储有计算机程序,所述处理器被设置运行所述计算机程序以执行所述权利要求1至5或6至10任一项中所述的方法的步骤。
PCT/CN2022/124212 2021-10-25 2022-10-09 参数调整方法、装置、存储介质及电子装置 WO2023071749A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111243760.1A CN114090918A (zh) 2021-10-25 2021-10-25 参数调整方法、装置、存储介质及电子装置
CN202111243760.1 2021-10-25

Publications (1)

Publication Number Publication Date
WO2023071749A1 true WO2023071749A1 (zh) 2023-05-04

Family

ID=80297617

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/124212 WO2023071749A1 (zh) 2021-10-25 2022-10-09 参数调整方法、装置、存储介质及电子装置

Country Status (2)

Country Link
CN (1) CN114090918A (zh)
WO (1) WO2023071749A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114090918A (zh) * 2021-10-25 2022-02-25 青岛海尔科技有限公司 参数调整方法、装置、存储介质及电子装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140098118A1 (en) * 2012-10-09 2014-04-10 Alibaba Group Holding Limited Graphic Rendering
US20170359434A1 (en) * 2016-06-14 2017-12-14 Microsoft Technology Licensing, Llc Web caching with image and local storage
CN110297996A (zh) * 2019-05-21 2019-10-01 深圳壹账通智能科技有限公司 基于h5页面的动画显示方法、装置、设备及存储介质
CN114090918A (zh) * 2021-10-25 2022-02-25 青岛海尔科技有限公司 参数调整方法、装置、存储介质及电子装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140098118A1 (en) * 2012-10-09 2014-04-10 Alibaba Group Holding Limited Graphic Rendering
US20170359434A1 (en) * 2016-06-14 2017-12-14 Microsoft Technology Licensing, Llc Web caching with image and local storage
CN110297996A (zh) * 2019-05-21 2019-10-01 深圳壹账通智能科技有限公司 基于h5页面的动画显示方法、装置、设备及存储介质
CN114090918A (zh) * 2021-10-25 2022-02-25 青岛海尔科技有限公司 参数调整方法、装置、存储介质及电子装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
YE CHAOLIU; MA LINSHAN: "Design of Responsive Layout Web Page Based on HTML 5 + CSS3 + jQuery", JOURNAL OF WUZHOU UNIVERSITY, vol. 28, no. 3, 15 June 2016 (2016-06-15), pages 22 - 35, XP009550861, ISSN: 1673-8535 *

Also Published As

Publication number Publication date
CN114090918A (zh) 2022-02-25

Similar Documents

Publication Publication Date Title
US10009303B2 (en) Message push method and apparatus
CN106572139B (zh) 多终端控制方法、终端、服务器和系统
US8260843B2 (en) Apparatus and method for providing remote user interface
US11019176B2 (en) Information processing apparatus, information processing system, information processing method and recording medium
US10419822B2 (en) Method, device, and system for switching at a mobile terminal of a smart television and acquiring information at a television terminal
CN110990741B (zh) 一种页面展示方法、装置、电子设备、服务器及存储介质
CN108965932B (zh) 一种连麦窗口展示方法及装置
CN102662618B (zh) 远程协助过程中的图像处理方法及装置
US20180338054A1 (en) Image reading apparatus transmitting device identification information and reading information to push notification server, and method for controlling the image reading apparatus
US10908889B2 (en) Method, user equipment, and application server for downloading application
WO2023071749A1 (zh) 参数调整方法、装置、存储介质及电子装置
CN113612979A (zh) 一种投影方法、电子设备及计算机设备
CN107835445B (zh) 基于mqtt协议的电视控制方法、移动终端及电视
CN111796885A (zh) 云端应用程序的显示方法、装置及电子设备
US20150161923A1 (en) Electronic device, display device, method, and computer program product
CN112947905B (zh) 一种图片加载方法、装置
CN111381749A (zh) 一种图像显示和处理方法、装置、设备和存储介质
CN110928509B (zh) 显示控制方法、显示控制装置、存储介质、通信终端
CN104391576A (zh) 一种基于无线以太网的远程输入的方法和装置
CN112333190B (zh) 会话控制方法、会话控制设备及计算机可读存储介质
CN110913268A (zh) 一种多屏互动的方法、装置及电子设备
CN113709541A (zh) 基于web的多终端设备互动方法、系统、终端设备
CN112235633A (zh) 输出效果调节方法、装置、设备及计算机可读存储介质
CN114077409A (zh) 投屏方法及装置、电子设备和计算机可读介质
CN116204257B (zh) 图像预览方法、装置、存储介质及计算机设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22885630

Country of ref document: EP

Kind code of ref document: A1