Dynamic Proxy-Based Screen Adaptation Method and Related Devices

Through the dynamic proxy generation screen adaptation method, the screen adaptation problem on the screen of different devices is solved, and the flexible code adaptation and maintenance is realized.

CN115834685BActive Publication Date: 2025-07-22CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211436313.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-16
Publication Date
2025-07-22
Estimated Expiration
2042-11-16

AI Technical Summary

Technical Problem

In the financial technology business, it is difficult for the existing technology to achieve screen adaptation on different proportions of device screens, resulting in wasted development time and difficult to locate and maintain code.

Method used

The screen adaptation method based on dynamic proxy is adopted to obtain screen object access requests through the server, generate proxy objects, and identify screen-related attributes. The preset data conversion rules are used for adaptive conversion to generate adaptive screen-related attributes.

Benefits of technology

Without changing the display code, the page content is adapted on different screens, which facilitates post-code positioning and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115834685B_ABST
    Figure CN115834685B_ABST
Patent Text Reader

Abstract

The embodiment of this application belongs to the technical field of fintech and is applied to the field of screen adaptation of financial APPs. It involves a screen adaptation method based on dynamic proxy and its related devices, including obtaining a screen object access request; sending a service proxy request to a proxy middleware according to the access request; generating a proxy object according to the service proxy request and a preset original screen object; accessing the proxy object and identifying screen-related attributes in the proxy object, where the screen-related attributes include screen width and screen height; performing screen adaptation conversion on the screen-related attributes according to the screen-related attributes and a preset data conversion rule to generate adapted screen-related attributes. Without changing the display code, this application adapts page content to different screens, facilitating the later positioning and maintenance of code content.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical fields of fintech and financial APP screen adaptation, and particularly relates to a screen adaptation method based on dynamic proxy and related devices. Background Art

[0002] With the addition of new business scenarios, the number of pages of APPs to be developed is increasing. There is often a situation where an APP needs to be displayed on the screens of multiple devices with different ratios.

[0003] Taking the Good Driver and Good Life APPs in fintech business as examples, the Good Driver and Good Life APPs need to be displayed on computer screens with different ratios and mobile phone screens of different models. Screen adaptation is a way to keep the same style of code displayed consistently on different-sized screens. When developing for mobile phones or H5, screen adaptation is particularly painful. Adapting various screen sizes is headache-inducing. Often, the values marked on the design drawings cannot be directly filled into the style sheets and need to be converted, which not only wastes development time, destroys the readability of the code, but also undermines the design of style separation, making the entire code difficult to locate and maintain. Summary of the Invention

[0004] The purpose of the embodiments of this application is to propose a screen adaptation method based on dynamic proxy and related devices, so as to adapt page content to different screens without changing the display code, facilitating the later positioning and maintenance of code content.

[0005] To solve the above technical problems, the embodiments of this application provide a screen adaptation method based on dynamic proxy, adopting the following technical solutions:

[0006] A screen adaptation method based on dynamic proxy includes the following steps:

[0007] The server obtains a screen object access request sent by the client, and sends a proxy object creation request to the proxy middleware according to the access request;

[0008] The proxy middleware obtains the proxy object creation request and generates a proxy object according to the proxy object creation request and a preset original screen object;

[0009] The client accesses the proxy object and identifies the screen-related attributes in the proxy object, where the screen-related attributes include screen width and screen height;

[0010] The client performs screen adaptation conversion on the screen-related attributes according to the screen-related attributes and a preset data conversion rule, generating adapted screen-related attributes.

[0011] Further, the step of generating a proxy object according to the service proxy request and a preset original screen object specifically includes:

[0012] Generate a request according to the proxy object, input the original screen object as a parameter object into a preset proxy object generation method, and generate a proxy object.

[0013] Further, the step of generating a request according to the proxy object, inputting the original screen object as a parameter object into a preset proxy object generation method, and generating a proxy object specifically includes:

[0014] Obtain all the attribute names and attribute values in the original screen object, and construct a key-value data set;

[0015] According to the attribute names preset for representing screen-related attributes, sequentially determine whether the attribute name corresponding to the current attribute value in the data set is a screen-related attribute;

[0016] If the attribute name corresponding to the current attribute value is a screen-related attribute, obtain the current attribute value and the attribute name corresponding to the current attribute value, store them in a new set generated through a proxy middleware, and use the finally filled new set as the proxy object.

[0017] Further, the step of identifying screen-related attributes in the proxy object specifically includes:

[0018] Respectively use the attribute fields representing the screen width and screen height as retrieval fields, obtain the attribute values corresponding to the attribute fields respectively, and use the attribute values as the screen-related attributes in the proxy object.

[0019] Further, before the step of the client performing screen adaptation conversion on the screen-related attributes according to the screen-related attributes and a preset data conversion rule to generate adapted screen-related attributes, the method further includes:

[0020] The client determines whether a screen page rendering request is obtained according to a preset listening component;

[0021] If the screen page rendering request is not obtained, delay the execution of the step of performing screen adaptation conversion on the screen-related attributes according to the screen-related attributes and a preset data conversion rule according to a preset delay device;

[0022] If the screen page rendering request is obtained, stop the delay device and execute the step of performing screen adaptation conversion on the screen-related attributes according to the screen-related attributes and a preset data conversion rule.

[0023] Further, before the step of generating a proxy object according to the service proxy request and the preset original screen object, the method further includes:

[0024] Obtain a pre-created original screen object, where the attributes in the original screen object at least include an initialized screen height and an initialized screen width;

[0025] Perform forward serialization processing on the original screen object, and then perform reverse serialization processing on the forward serialization processing result to obtain a reverse serialization processing result;

[0026] Obtain the reverse serialization processing result as a deep copy object.

[0027] Further, the step of performing screen adaptation conversion on the screen-related attributes according to the screen-related attributes and the preset data conversion rules specifically includes:

[0028] Use the screen-related attributes in the deep copy object as the value to be converted;

[0029] Perform pixel scaling conversion on the value to be converted through a preset data scaling algorithm and the pixel ratio of the target screen to obtain a pixel value adapted to the screen, where the data scaling algorithm is a predefined pixel conversion algorithm.

[0030] To solve the above technical problems, an embodiment of the present application further provides a screen adaptation device based on dynamic proxy, which adopts the following technical solutions:

[0031] A screen adaptation device based on dynamic proxy includes a server, a proxy middleware, and a client, where:

[0032] The server is used to obtain a screen object access request sent by the client and send a proxy object creation request to the proxy middleware according to the access request;

[0033] The proxy middleware is used to obtain the proxy object creation request and generate a proxy object according to the proxy object creation request and a preset original screen object,

[0034] The client is used to access the proxy object and identify the screen-related attributes in the proxy object, where the screen-related attributes include screen width and screen height;

[0035] The client is further used to perform screen adaptation conversion on the screen-related attributes according to the screen-related attributes and the preset data conversion rules to generate adapted screen-related attributes.

[0036] To solve the above technical problems, an embodiment of the present application further provides a computer device, which adopts the following technical solutions:

[0037] A computer device includes a memory and a processor. Computer-readable instructions are stored in the memory, and when the processor executes the computer-readable instructions, the steps of the above-mentioned screen adaptation method based on dynamic proxy are implemented.

[0038] To solve the above technical problems, an embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solutions:

[0039] A computer-readable storage medium has computer-readable instructions stored thereon. When the computer-readable instructions are executed by a processor, the steps of the screen adaptation method based on dynamic proxy as described above are implemented.

[0040] Compared with the prior art, the embodiments of the present application mainly have the following beneficial effects:

[0041] For the screen adaptation method based on dynamic proxy in the embodiments of the present application, a screen object access request is obtained; according to the access request, a service proxy request is sent to a proxy middleware; according to the service proxy request and a preset original screen object, a proxy object is generated; the proxy object is accessed, and screen-related attributes in the proxy object are identified, where the screen-related attributes include screen width and screen height; according to the screen-related attributes and a preset data conversion rule, screen adaptation conversion is performed on the screen-related attributes to generate adapted screen-related attributes. Without changing the display code, the present application adapts the page content to different screens, which is convenient for later positioning and maintenance of the code content. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] To more clearly illustrate the solutions in the present application, the following briefly introduces the drawings required for the description of the embodiments of the present application. Obviously, the following-described drawings are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0043] Figure 1 is an exemplary system architecture diagram to which the present application can be applied;

[0044] Figure 2 A flowchart of an embodiment of the screen adaptation method based on dynamic proxy according to the present application;

[0045] Figure 3 is Figure 2 a flowchart of a specific implementation manner of step 202 shown;

[0046] Figure 4 Structural schematic diagram of an embodiment of the screen adaptation device based on dynamic proxy according to the present application;

[0047] Figure 5 Structural schematic diagram of an embodiment of the computer device according to the present application. Detailed implementation manners

[0048] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs; the terms used in the specification of this application are only for the purpose of describing specific embodiments, and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above drawings are intended to cover non-exclusive inclusion. The terms "first", "second", etc. in the specification and claims of this application or the above drawings are used to distinguish different objects, not to describe a specific order.

[0049] Reference to "embodiment" herein means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of this application. The phrase appears in various places in the specification and is not necessarily referring to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.

[0050] To enable those skilled in the technical field to better understand the solutions of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.

[0051] As Figure 1 shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.

[0052] Users can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0053] The terminal devices 101, 102, and 103 can be various electronic devices with a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, desktop computers, and so on.

[0054] The server 105 can be a server that provides various services, such as a background server that supports the pages displayed on the terminal devices 101, 102, and 103.

[0055] It should be noted that the screen adaptation method based on dynamic proxy provided in the embodiments of the present application is generally executed by the server / terminal device. Correspondingly, the screen adaptation device based on dynamic proxy is generally set in the server / terminal device.

[0056] It should be understood that Figure 1 the numbers of the terminal devices, networks, and servers in

[0057] Continuing to refer to Figure 2 , a flowchart of an embodiment of the screen adaptation method based on dynamic proxy according to the present application is shown. The screen adaptation method based on dynamic proxy includes the following steps:

[0058] Step 201, the server side obtains a screen object access request sent by the client, and sends a proxy object creation request to the proxy middleware according to the access request.

[0059] In this embodiment, in the form of a trigger, when the obtained screen object access request is received, the method of sending a service proxy request to the proxy middleware written in advance is executed through the trigger.

[0060] By setting the trigger, it is possible to send a service proxy request to the proxy middleware in a timely manner when the screen object access request is obtained, improving the processing efficiency.

[0061] Step 202, the proxy middleware obtains the proxy object creation request, and generates a proxy object according to the proxy object creation request and a preset original screen object.

[0062] In this embodiment, before the step of generating a proxy object according to the service proxy request and the preset original screen object, the method further includes: obtaining a pre-created original screen object, where the attributes in the original screen object at least include an initialized screen height and an initialized screen width; performing forward serialization processing on the original screen object, and then performing reverse serialization processing on the result of the forward serialization processing to obtain a result of the reverse serialization processing; and obtaining the result of the reverse serialization processing as a deep copy object.

[0063] In this embodiment, the deep copy object refers to a copy object of the original screen object, which avoids directly calling the original data corresponding to the original screen object and prevents the original data from being contaminated.

[0064] By performing forward serialization processing on the original screen object, and then performing reverse serialization processing on the result of the forward serialization processing to obtain a result of the reverse serialization processing; and obtaining the result of the reverse serialization processing as a deep copy object, it avoids obtaining values from the original screen object during later screen adaptation of the program, changing the original data, and directly implementing screen adaptation by calling the deep copy object.

[0065] In this embodiment, the step of generating a proxy object according to the proxy object creation request and the preset original screen object specifically includes: if the service proxy request is obtained according to a preset listening component, sending a proxy object generation request to the proxy middleware; and according to the proxy object generation request, inputting the original screen object as a parameter object into a preset proxy object generation method to generate a proxy object.

[0066] Generating a proxy object through the original screen object ensures that the attribute values and attribute names of the proxy object both originate from the original screen object.

[0067] Continue to refer to Figure 3 , Figure 3 is Figure 2 a flowchart of a specific embodiment of step 202 shown in

[0068] Step 301, obtaining all the attribute names and attribute values in the original screen object, and constructing a key-value data set;

[0069] Step 302, according to the attribute names preset for representing screen-related attributes, sequentially determining whether the attribute name corresponding to the current attribute value in the data set is a screen-related attribute;

[0070] Step 303: If the attribute name corresponding to the current attribute value is a screen-related attribute, obtain the current attribute value and the attribute name corresponding to the current attribute value, store them in a new set generated by the proxy middleware, and use the new set with the final value filled as the proxy object.

[0071] By obtaining the screen-related attributes in the original screen object and constructing a proxy object, essentially, the non-screen-related attributes in the original screen object are deleted, and only the attributes used for screen adaptation are retained to reconstruct the object, avoiding the time-consuming search for non-related attributes during screen adaptation.

[0072] Step 203: The client accesses the proxy object and identifies the screen-related attributes in the proxy object, where the screen-related attributes include the screen width and the screen height.

[0073] In this embodiment, the step of identifying the screen-related attributes in the proxy object specifically includes: using the attribute fields representing the screen width and the screen height as search fields respectively, obtaining the attribute values corresponding to the attribute fields respectively, and using the attribute values as the screen-related attributes in the proxy object.

[0074] Step 204: The client performs screen adaptation conversion on the screen-related attributes according to the screen-related attributes and the preset data conversion rules to generate adapted screen-related attributes.

[0075] In this embodiment, before the step of performing screen adaptation conversion on the screen-related attributes according to the screen-related attributes and the preset data conversion rules to generate adapted screen-related attributes, the method further includes: the client determines whether a screen page rendering request is obtained according to a preset listening component; if the screen page rendering request is not obtained, the step of performing screen adaptation conversion on the screen-related attributes according to the screen-related attributes and the preset data conversion rules is delayed according to a preset delay device; if the screen page rendering request is obtained, the delay device is stopped, and the step of performing screen adaptation conversion on the screen-related attributes according to the screen-related attributes and the preset data conversion rules is executed.

[0076] Through delay control, screen adaptation is performed when the page is rendered. The advantage of this is to avoid directly rendering when the screen object is obtained, which is equivalent to performing intermediate control and realizing the separation of the screen object access request and the page rendering request.

[0077] Through the listening component and the delay device, it is ensured that the screen adaptation-related attributes are called during page rendering, avoiding the premature call of the screen adaptation-related attributes.

[0078] In this embodiment, the step of performing screen adaptation conversion on the screen-related attributes according to the screen-related attributes and the preset data conversion rules specifically includes: using the screen-related attributes in the deep copy object as the value to be converted; performing pixel scaling conversion on the value to be converted through a preset data scaling algorithm and the pixel ratio of the target screen to obtain a pixel value adapted to the screen, where the data scaling algorithm is a predefined pixel conversion algorithm.

[0079] This application obtains a screen object access request; according to the access request, sends a service proxy request to a proxy middleware; generates a proxy object according to the service proxy request and a preset original screen object; accesses the proxy object and identifies the screen-related attributes in the proxy object, where the screen-related attributes include screen width and screen height; performs screen adaptation conversion on the screen-related attributes according to the screen-related attributes and the preset data conversion rules to generate adapted screen-related attributes. Without changing the display code, this application adapts the page content to different screens, facilitating the later positioning and maintenance of the code content.

[0080] Embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) uses a digital computer or a machine controlled by a digital computer to simulate, extend, and expand human intelligence, sense the environment, acquire knowledge, and use the knowledge to obtain the best results in terms of theory, method, technology, and application systems.

[0081] Artificial intelligence basic technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technologies mainly include several major directions such as computer vision technology, robotics technology, biometric technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0082] In an embodiment of this application, a screen adaptation model based on dynamic proxy can be trained according to the screen adaptation method based on dynamic proxy, and an artificial intelligence model is used for target screen adaptation, which is more intelligent and automated.

[0083] Further reference Figure 4 to Figure 2 As an implementation of the method shown above, this application provides an embodiment of a screen adaptation device based on dynamic proxy. This device embodiment corresponds to the method embodiment shown in Figure 2 and can be specifically applied to various electronic devices.

[0084] such asFigure 4 As shown in Figure 4 , the screen adaptation device 400 based on dynamic proxy according to this embodiment includes: a server 401, a proxy middleware 402, and a client 403, where:

[0085] The server 401 is configured to obtain a screen object access request sent by the client 403, and send a proxy object creation request to the proxy middleware 402 according to the access request;

[0086] The proxy middleware 402 is configured to obtain the proxy object creation request, and generate a proxy object according to the proxy object creation request and a preset original screen object;

[0087] The client 403 is configured to access the proxy object and identify screen-related attributes in the proxy object, where the screen-related attributes include screen width and screen height;

[0088] The client 403 is further configured to perform screen adaptation conversion on the screen-related attributes according to the screen-related attributes and a preset data conversion rule, and generate adapted screen-related attributes.

[0089] This application obtains a screen object access request; sends a service proxy request to the proxy middleware according to the access request; generates a proxy object according to the service proxy request and a preset original screen object; accesses the proxy object and identifies screen-related attributes in the proxy object, where the screen-related attributes include screen width and screen height; performs screen adaptation conversion on the screen-related attributes according to the screen-related attributes and a preset data conversion rule, and generates adapted screen-related attributes. Without changing the display code, this application adapts the page content to different screens, which is convenient for later positioning and maintenance of the code content.

[0090] In some specific embodiments of this application, the screen adaptation device based on dynamic proxy further includes an object deep copy component, which is configured to obtain a pre-created original screen object, where the attributes in the original screen object at least include an initialized screen height and an initialized screen width; obtain a reverse serialization processing result by performing forward serialization processing on the original screen object and then performing reverse serialization processing on the forward serialization processing result; obtain the reverse serialization processing result as a deep copy object.

[0091] In some specific embodiments of the present application, the screen adaptation device based on dynamic proxy further includes a delay control component. The delay control component is used to determine whether a screen page rendering request is obtained according to a preset listening component. If the screen page rendering request is not obtained, the step of performing screen adaptation conversion on the screen-related attributes according to the screen-related attributes and a preset data conversion rule is delayed according to a preset delay device. If the screen page rendering request is obtained, the delay device is stopped, and the step of performing screen adaptation conversion on the screen-related attributes according to the screen-related attributes and the preset data conversion rule is executed.

[0092] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through computer-readable instructions. The computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), etc., or a random access memory (RAM), etc.

[0093] It should be understood that although the steps in the flowchart of the accompanying drawings are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps has no strict order limit, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.

[0094] To solve the above technical problems, the embodiments of the present application also provide a computer device. For details, please refer to Figure 5 , Figure 5 which is the basic structural block diagram of the computer device in this embodiment.

[0095] The computer device 5 includes a memory 51, a processor 52, and a network interface 53 that are communicatively connected to each other via a system bus. It should be noted that only the computer device 5 with components 51-53 is shown in the figure, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Among them, those skilled in the art of the present technology can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, a microprocessor, an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a digital signal processor (DSP), an embedded device, etc.

[0096] The computer device can be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The computer device can perform human-computer interaction with the user through means such as a keyboard, a mouse, a remote control, a touchpad, or a voice control device.

[0097] The memory 51 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, a hard disk, a multimedia card, a card-type memory (such as an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 51 can be an internal storage unit of the computer device 5, such as the hard disk or memory of the computer device 5. In other embodiments, the memory 51 can also be an external storage device of the computer device 5, such as a plug-in hard disk equipped on the computer device 5, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Of course, the memory 51 can also include both the internal storage unit of the computer device 5 and its external storage device. In this embodiment, the memory 51 is generally used to store the operating system and various application software installed on the computer device 5, such as computer-readable instructions for the screen adaptation method based on dynamic proxy. In addition, the memory 51 can also be used to temporarily store various data that have been output or will be output.

[0098] In some embodiments, the processor 52 may be a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips. The processor 52 is generally used to control the overall operation of the computer device 5. In this embodiment, the processor 52 is used to run the computer-readable instructions stored in the memory 51 or process data, such as running the computer-readable instructions of the screen adaptation method based on dynamic proxy.

[0099] The network interface 53 may include a wireless network interface or a wired network interface. The network interface 53 is generally used to establish a communication connection between the computer device 5 and other electronic devices.

[0100] The computer device proposed in this embodiment belongs to the technical field of financial APP screen adaptation. This application obtains a screen object access request; according to the access request, sends a service proxy request to the proxy middleware; generates a proxy object according to the service proxy request and a preset original screen object; accesses the proxy object and identifies the screen-related attributes in the proxy object, where the screen-related attributes include screen width and screen height; performs screen adaptation conversion on the screen-related attributes according to the screen-related attributes and a preset data conversion rule to generate adapted screen-related attributes. Without changing the display code, this application adapts the page content to different screens, facilitating the later positioning and maintenance of the code content.

[0101] This application also provides another implementation manner, that is, to provide a computer-readable storage medium storing computer-readable instructions that can be executed by a processor to cause the processor to execute the steps of the screen adaptation method based on dynamic proxy as described above.

[0102] The computer-readable storage medium proposed in this embodiment belongs to the technical field of financial APP screen adaptation. This application obtains a screen object access request; according to the access request, sends a service proxy request to the proxy middleware; generates a proxy object according to the service proxy request and a preset original screen object; accesses the proxy object and identifies the screen-related attributes in the proxy object, where the screen-related attributes include screen width and screen height; performs screen adaptation conversion on the screen-related attributes according to the screen-related attributes and a preset data conversion rule to generate adapted screen-related attributes. Without changing the display code, this application adapts the page content to different screens, facilitating the later positioning and maintenance of the code content.

[0103] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described example methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present application.

[0104] Obviously, the above-described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The accompanying drawings show the preferred embodiments of the present application, but do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosed content of the present application more thorough and comprehensive. Although the present application has been described in detail with reference to the foregoing embodiments, for those skilled in the art, they can still modify the technical solutions described in the foregoing specific embodiments, or perform equivalent replacements for some of the technical features. Any equivalent structure directly or indirectly using the content of the specification and drawings of the present application in other related technical fields shall be within the scope of the patent protection of the present application by the same token.

Claims

1. A screen adaptation method based on dynamic proxy, characterized in that Including the following steps: The server obtains a screen object access request sent by the client, and according to the access request, in the form of a trigger, sends a proxy object creation request to the proxy middleware. Specifically, when the obtained screen object access request is received, a method of sending a service proxy request to the proxy middleware written in advance is executed through a preset trigger, so as to realize sending a proxy object creation request to the proxy middleware; The proxy middleware obtains the proxy object creation request, and generates a proxy object according to the proxy object creation request and a preset original screen object; The client accesses the proxy object and identifies screen-related attributes in the proxy object, where the screen-related attributes include screen width and screen height; The client performs screen adaptation conversion on the screen-related attributes according to the screen-related attributes and a preset data conversion rule, and generates adapted screen-related attributes. Before the step where the client performs screen adaptation conversion on the screen-related attributes according to the screen-related attributes and the preset data conversion rule to generate adapted screen-related attributes, the method further includes: The client judges whether a screen page rendering request is obtained according to a preset listening component; If the screen page rendering request is not obtained, the step of performing screen adaptation conversion on the screen-related attributes according to the screen-related attributes and the preset data conversion rule is delayed according to a preset delay device; If the screen page rendering request is obtained, the delay device is stopped, and the step of performing screen adaptation conversion on the screen-related attributes according to the screen-related attributes and the preset data conversion rule is executed.

2. The screen adaptation method based on dynamic proxy according to claim 1, wherein The step of generating a proxy object according to the proxy object creation request and a preset original screen object specifically includes: According to the proxy object creation request, taking the original screen object as an input parameter object and inputting it into a preset proxy object generation method to generate a proxy object.

3. The screen adaptation method based on dynamic proxy according to claim 2, wherein The step of generating a proxy object by taking the original screen object as an input parameter object and inputting it into a preset proxy object generation method according to the proxy object creation request specifically includes: Obtaining all the attribute names and attribute values in the original screen object, and constructing a key-value data set; According to the attribute names preset to represent screen-related attributes, sequentially judging whether the attribute name corresponding to the current attribute value in the data set is a screen-related attribute; If the attribute name corresponding to the current attribute value is a screen-related attribute, obtaining the current attribute value and the attribute name corresponding to the current attribute value, storing them in a new set generated by the proxy middleware, and taking the finally filled new set as the proxy object.

4. The screen adaptation method based on dynamic proxy according to claim 1, wherein The step of identifying screen-related attributes in the proxy object specifically includes: Taking the attribute fields representing screen width and screen height as retrieval fields respectively, obtaining the attribute values corresponding to the attribute fields respectively, and taking the attribute values as the screen-related attributes in the proxy object.

5. The screen adaptation method based on dynamic proxy according to claim 1, wherein Before the step of generating a proxy object according to the proxy object creation request and a preset original screen object, the method further includes: Obtain a pre-created original screen object, where the attributes in the original screen object at least include the initialized screen height and the initialized screen width; Through forward serialization processing of the original screen object and then reverse serialization processing of the forward serialization processing result, obtain the reverse serialization processing result; Obtain the reverse serialization processing result as a deep copy object.

6. The screen adaptation method based on dynamic proxy according to claim 5, wherein The step of performing screen adaptation conversion on the screen-related attributes according to the screen-related attributes and the preset data conversion rules specifically includes: Use the screen-related attributes in the deep copy object as the value to be converted; Through a preset data scaling algorithm and the pixel ratio of the target screen, perform pixel scaling conversion on the value to be converted to obtain a pixel value adapted to the screen, where the data scaling algorithm is a predefined pixel conversion algorithm.

7. A screen adaptation device based on dynamic proxy, comprising a server, a proxy middleware and a client, characterized in that, The screen adaptation device based on dynamic proxy is used to implement the steps of the screen adaptation method based on dynamic proxy as described in any one of claims 1 to 6, The server is used to obtain a screen object access request sent by the client and send a proxy object creation request to the proxy middleware according to the access request; The proxy middleware is used to obtain the proxy object creation request and generate a proxy object according to the proxy object creation request and the preset original screen object, The client is used to access the proxy object and identify the screen-related attributes in the proxy object, where the screen-related attributes include the screen width and the screen height; The client is also used to perform screen adaptation conversion on the screen-related attributes according to the screen-related attributes and the preset data conversion rules to generate adapted screen-related attributes.

8. A computer device, including a memory and a processor, where computer-readable instructions are stored in the memory, and when the processor executes the computer-readable instructions, the steps of the screen adaptation method based on dynamic proxy as described in any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium, characterized in that, Computer-readable instructions are stored on the computer-readable storage medium, and when the computer-readable instructions are executed by the processor, the steps of the screen adaptation method based on dynamic proxy as described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Screen switching display method and device, intelligent rearview mirror and readable storage medium

    CN111666056A

  • Screen adaptation method and device, electronic equipment and storage medium

    CN111694530A