Client screen adaptation method, device and electronic device

By detecting and generating adapted business user interface layout parameter values ​​and configuration files, the problem of large workload of client screen adaptation is solved, dynamic screen adaptation is realized, and code maintenance and debugging process is simplified.

CN114780198BActive Publication Date: 2024-12-20ADVANCED NEW TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210612873.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-12-28
Publication Date
2024-12-20
Estimated Expiration
2038-12-28

AI Technical Summary

Technical Problem

In the prior art, with the increase in client types, screen adaptation workload is large, and page layout code is difficult to maintain. The existing screen adaptation method needs to be implemented by modifying the debug layout code, resulting in relatively high code understanding and debugging time. many.

Method used

By detecting the parameter value displayed on the client screen, we can determine whether it is suitable for the preset layout parameter value. If it is not suitable, we generate the appropriate business user interface layout parameter value and configuration file, separate the layout parameter value and code, and realize the dynamic screen adaptation.

Benefits of technology

It reduces the time for code debugging and self-testing, improves work efficiency, facilitates client screen adaptation, and avoids complex compatibility issues in page layout code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114780198B_ABST
    Figure CN114780198B_ABST
Patent Text Reader

Abstract

The embodiments of this specification disclose a client screen adaptation method, device and electronic device, which detect the client screen display parameter value, determine whether the client screen display parameter value is adapted to the preset layout parameter value of the business user interface, and if not, generate the adapted layout parameter value of the business user interface according to the client display parameter value, generate a configuration file according to the correspondence between the identifier of the business and the layout parameter value of the generated business user interface, render the business user interface according to the generated configuration file, and generate the corresponding business user interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present specification relate to the field of screen adaptation technology, and in particular to a client screen adaptation method, device and electronic device. Background Art

[0002] In the prior art, the client draws the UI (user interface) layout mainly based on code, and some business scenarios have very high requirements for UI layout. The existing screen adaptation generally needs to be completed according to the client's screen display parameters by modifying the debugging layout code, debugging logic and self-testing. Summary of the invention

[0003] In view of this, the embodiments of this specification provide a client screen adaptation method, device and electronic device for solving the problem in the prior art that the business user interface layout code for screen adaptation needs to be compatible with an increasing number of models and the business user interface layout code is difficult to maintain.

[0004] The embodiments of this specification adopt the following technical solutions:

[0005] This specification embodiment provides a client screen adaptation method, including:

[0006] Detect the parameter values ​​displayed on the client screen;

[0007] Determining whether the client screen display parameter value is compatible with the preset layout parameter value of the service user interface;

[0008] If not, determining the layout parameter value of the adapted service user interface according to the client display parameter value;

[0009] Generate a configuration file according to the correspondence between the identifier of the service and the layout parameter value of the generated service user interface;

[0010] The business user interface is rendered according to the generated configuration file to generate a corresponding business user interface.

[0011] The embodiment of this specification also provides a client screen adaptation method, comprising:

[0012] Receiving a service request, wherein the service request includes a service identifier and a client screen display parameter value;

[0013] A configuration file is searched according to the identifier of the service and the client screen display parameter value, wherein the configuration file includes a layout parameter value of a service user interface corresponding to the identifier of the service, and the layout parameter value of the service user interface is generated according to the client screen display parameter value when the degree of compatibility between the client screen display parameter value and the preset layout parameter value of the service user interface is no;

[0014] The business user interface is rendered according to the layout parameter value of the business user interface to generate the corresponding business user interface.

[0015] The embodiment of the present specification also provides a client screen adaptation device, comprising:

[0016] Detection module, detects the parameter values ​​displayed on the client screen;

[0017] A judgment module, judging whether the client screen display parameter value is compatible with the preset layout parameter value of the business user interface;

[0018] a layout parameter value generating module, which generates a layout parameter value of an adapted service user interface according to the client display parameter value if the judgment result of the judgment module is no;

[0019] A file generation module, generating a configuration file according to a correspondence between the business identifier and the layout parameter value of the generated business user interface;

[0020] The rendering module renders the business user interface according to the generated configuration file to generate a corresponding business user interface.

[0021] The embodiment of the present specification also provides a client screen adaptation device, comprising:

[0022] A receiving module receives a service request, wherein the service request includes a service identifier and a client screen display parameter value;

[0023] a query module, querying a configuration file according to the identifier of the service and the client screen display parameter value, wherein the configuration file includes a layout parameter value of a service user interface corresponding to the identifier of the service, and the layout parameter value of the service user interface is generated according to the client display parameter value when the degree of compatibility between the client screen display parameter value and the preset layout parameter value of the service user interface is no;

[0024] A rendering module generates the business user interface according to the layout parameter value of the business user interface.

[0025] The embodiment of the present specification also provides an electronic device, including at least one processor and a memory, wherein the memory stores a program and is configured to execute the following steps by the at least one processor:

[0026] Detect the parameter values ​​displayed on the client screen;

[0027] Determining whether the client screen display parameter value is compatible with the preset layout parameter value of the service user interface;

[0028] If not, generating a layout parameter value of an adapted service user interface according to the client display parameter value;

[0029] Generate a configuration file according to the correspondence between the identifier of the service and the layout parameter value of the generated service user interface;

[0030] The business user interface is rendered according to the generated configuration file to generate a corresponding business user interface.

[0031] The embodiment of the present specification also provides an electronic device, including at least one processor and a memory, wherein the memory stores a program and is configured to execute the following steps by the at least one processor:

[0032] Receiving a service request, wherein the service request includes a service identifier and a client screen display parameter value;

[0033] A configuration file is searched according to the identifier of the service and the client screen display parameter value, wherein the configuration file includes a layout parameter value of a service user interface corresponding to the identifier of the service, and the layout parameter value of the service user interface is generated according to the client screen display parameter value when the degree of compatibility between the client screen display parameter value and the preset layout parameter value of the service user interface is no;

[0034] The business user interface is rendered according to the layout parameter value of the business user interface to generate the corresponding business user interface.

[0035] At least one of the above-mentioned technical solutions adopted in the embodiments of this specification can achieve the following beneficial effects: it can generate layout parameter values ​​and configuration files of an adapted business user interface according to the client screen display parameters, separate the layout parameter values ​​of the business user interface from the code, and realize dynamic screen adaptation according to the generated layout parameter values ​​of the adapted business user interface. There is no need to adjust the code or logic, which can save a lot of time for code understanding, debugging and self-testing, improve work efficiency, and facilitate client screen adaptation. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The drawings described herein are used to provide a further understanding of the embodiments of this specification and constitute a part of the embodiments of this specification. The illustrative embodiments of this specification and their descriptions are used to explain this application and do not constitute an improper limitation on this application. In the drawings:

[0037] Figure 1 A flowchart of a client screen adaptation method provided in an embodiment of this specification;

[0038] Figure 2 A flowchart of a client screen adaptation method provided in an embodiment of this specification;

[0039] Figure 3 A schematic diagram of a client screen adaptation device provided in an embodiment of this specification;

[0040] Figure 4 A schematic diagram of a client screen adaptation device provided in an embodiment of this specification;

[0041] Figure 5 A client screen adaptation method and device provided in an embodiment of this specification generates a timing diagram of a business user interface according to a generated configuration file;

[0042] Figure 6 A client screen adaptation method and device provided in the embodiment of this specification generates a timing diagram of a business user page according to a configuration file issued;

[0043] Figure 7 A service access flow chart of a client screen adaptation method provided in an embodiment of this specification. DETAILED DESCRIPTION

[0044] In the prior art, as the number of client types increases, in order to enable various business pages to display and run without distortion on different types of clients, screen adaptation needs to be performed for different types of clients. Screen adaptation is generally achieved by modifying and debugging the page layout code. Therefore, the page layout code for screen adaptation needs to be compatible with more and more types of clients, and thus the workload of screen adaptation becomes larger and larger, making the page layout code more and more difficult to maintain. Therefore, the present application provides a client screen adaptation method, device and electronic device, which can generate adapted business user interface layout parameter values ​​and configuration files according to the client screen display parameters, separate the layout parameter values ​​of the business user interface from the code, and realize dynamic screen adaptation.

[0045] In order to make the purpose, technical solution and advantages of this application clearer, the technical solution of this application will be clearly and completely described below in conjunction with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0046] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.

[0047] Figure 1 This is a flowchart of a client screen adaptation method provided in an embodiment of this specification. The process is executed by the client, and some steps can also be executed by the server.

[0048] The embodiment of this specification provides a client screen adaptation method, which specifically includes the following steps:

[0049] S101: Detecting the client screen display parameter value;

[0050] Detect the client screen display parameter values, including,

[0051] When the business user interface is triggered, the parameter value displayed on the client screen is detected.

[0052] The client screen display parameter value is a parameter value used to represent the client screen display characteristics, such as screen resolution, screen physical size, screen ratio, etc., and is used to provide a reference for determining the layout parameter value of the business user interface.

[0053] When the application APP is installed on the client or when the application APP is started for the first time, the client screen display parameter values ​​are detected to provide a basis for the adaptation of the business user interface.

[0054] S103: Determine whether the client screen display parameter value is compatible with the preset layout parameter value of the service user interface;

[0055] In an embodiment of the present specification, if an application APP uses the present method to adapt the client screen, then when the application APP is developed, a preset layout parameter value will be generated for the business user interface of the application APP. The preset layout parameter value can be generated based on the display parameter value of a specified model of client, and the preset layout parameter value can be used to adapt the client screen of the specified model. In addition, for business user interfaces with low adaptation requirements, such as the registration business user interface of the application APP, the preset layout parameter value can also be used to adapt the client screen whose screen display parameter value is similar to the display parameter value of the client of the specified model. For example, for clients with a screen size of 3.5 inches, if the preset layout parameter value of the application APP registration business user interface is generated based on the screen display parameter value of one of the clients, the preset layout parameter value can also be used to adapt the application APP registration business user interface of other clients with a screen size of 3.5 inches.

[0056] The preset layout parameter values ​​may also be generated according to the display parameter values ​​of the specified same type of clients, and thus may be adapted to the service user interfaces of the specified same type of clients.

[0057] Specifically, the designated clients of the same type include, but are not limited to, clients of the same type having the same width or height of client screens, such as clients of the same type having the same screen width.

[0058] Preferably, the step S103 may include the following steps:

[0059] Determining an adapted preset client screen display parameter value according to the preset layout parameter value;

[0060] Determine whether the preset client screen display parameter value is compatible with the client screen display parameter value.

[0061] By judging whether the client screen display parameter value is compatible with the preset layout parameter value of the business user interface, if so, the preset layout parameter value can be called to complete the screen adaptation of the current client, saving the workload of screen adaptation; if not, proceed to the next step S105.

[0062] S105: If not, generating a layout parameter value of an adapted service user interface according to the client display parameter value;

[0063] The step S105 specifically includes the following steps:

[0064] determining at least one element layout attribute from layout elements of the business user interface;

[0065] According to the client display parameter value, an element layout attribute value corresponding to each element layout attribute is generated.

[0066] The element layout attribute may be determined based on the layout elements of the business user interface, and the layout elements may include various elements or controls that constitute the business user interface layout, such as the element layout attribute "button_width" is generated based on the width attribute of the interface element button of the business user interface; and a business user interface has more than one layout element, and there is at least one layout element that needs to be laid out, so at least one element layout attribute is determined.

[0067] The element layout attribute and the element layout attribute value correspond one to one, so that during the rendering process of the business user interface, the element layout attribute value corresponding to the element layout attribute can be obtained through the element layout attribute query.

[0068] S107: Generate a configuration file according to the correspondence between the identifier of the service and the layout parameter value of the generated service user interface.

[0069] The layout parameter values ​​of the generated service user interface are configured in the corresponding configuration file according to the identifier of the service.

[0070] The generated configuration file is stored in a file path corresponding to the client, and the file path corresponds to the identifier of the service, so as to facilitate query when calling the configuration file.

[0071] Optionally, the generated configuration file can be uploaded to a server and stored in the server, which is convenient for storage and updating to avoid loss, and can also facilitate other clients with the same display parameter values ​​to call the adapted configuration file.

[0072] Correspondingly, the preset layout parameter value is configured in a corresponding preset configuration file, and the preset configuration file is stored in a preset file path corresponding to the client.

[0073] S109: Rendering a business user interface according to the generated configuration file to generate a corresponding business user interface. The steps include:

[0074] Determining the location of the configuration file according to the identifier of the service;

[0075] Acquire the element layout attribute value corresponding to the element layout attribute from the configuration file;

[0076] The business user interface is rendered according to the element layout attribute value to generate a corresponding business user interface.

[0077] Preferably, determining the location of the configuration file according to the identifier of the service includes:

[0078] Acquire service registration information corresponding to the service identifier and the client screen display parameter value according to the service identifier and the client screen display parameter value, wherein the service registration information includes a configuration file name and a relative path of the configuration file;

[0079] The configuration file is obtained according to the configuration file name and the relative path.

[0080] When adapting the business user interface, in scenarios such as partial updates to the layout of the business user interface, you only need to update the business user interface layout parameter values ​​that need to be updated according to the screen adaptation needs, without having to update the entire configuration file.

[0081] The element layout attribute is the key value, the element layout attribute value corresponding to the element layout attribute is the value value, and the generated business user interface layout parameter value includes at least one set of key-value combination values.

[0082] The layout parameter values ​​of the business user interface include, but are not limited to, business page font size, font spacing, interface element size, image path, color value, and frame layout.

[0083] The file format of the configuration file exists in the form of key-value, which is simple and clear, without learning and maintenance costs such as hierarchy and category, and the key value can be arbitrarily taken according to the adaptation needs of the interface elements of the business user interface, which is simpler and purer in business access, with lower learning costs and better maintenance.

[0084] In the embodiment of this specification, the business user interface is rendered according to the element layout attribute value to complete the client screen adaptation. The object of adaptation is each layout element in the business user interface, and the adaptation effect is more accurate. For example, in daily life, QR codes or barcodes are often used. In order to ensure the accuracy of the use of QR codes or barcodes, the adaptation requirements for the business user interface of the QR code or barcode are very high. In addition, in different countries, the layout requirements for the QR code or barcode on the business user interface are different. In the prior art, when adapting the business user interface, the corresponding business user interface is enlarged or reduced as a whole. Although the purpose of adaptation can be achieved, for application scenarios with high adaptation requirements, such as QR codes or barcodes, errors are generated in the layout of the QR code or barcode in the business user interface after adaptation, such as deformation of the QR code or barcode after overall enlargement and reduction, and the distance between the QR code or barcode and the border of the business user interface does not meet the requirements. In this case, the use of the QR code or barcode will be affected, and the screen adaptation method provided in the embodiment of this specification can ensure the accuracy requirements for the use of the QR code or barcode.

[0085] The embodiment of this specification also provides a client screen adaptation method, such as Figure 2 shown.

[0086] Figure 2 This is a flowchart of a client screen adaptation method provided in an embodiment of this specification. The process is executed by the client, and some steps can also be executed by the server. Specifically, the following steps are included:

[0087] S201: receiving a service request, wherein the service request includes a service identifier and a client screen display parameter value;

[0088] Receive a service request. When the application APP is started, when the user operates the service of the application APP on the client, the service request will be sent. The service request includes the identifier of the service and the client screen display parameter value.

[0089] When the service user interface is triggered to start, the client screen display parameter value is detected.

[0090] Preferably, after receiving the service request, the method further includes:

[0091] querying the server according to the identifier of the service whether a configuration file corresponding to the identifier of the service is configured;

[0092] If yes, the configuration file adapted to the display parameter value of the client is sent from the server;

[0093] Load the configuration file into the client cache.

[0094] S203: querying a configuration file according to the identifier of the service and the client screen display parameter value, wherein the configuration file includes a layout parameter value of a service user interface corresponding to the identifier of the service, and the layout parameter value of the service user interface is generated according to the client screen display parameter value when the degree of compatibility between the client screen display parameter value and the preset layout parameter value of the service user interface is no;

[0095] Preferably, querying a configuration file according to the identifier of the service and the value of the parameter displayed on the client screen includes:

[0096] Acquire service registration information corresponding to the service identifier and the client screen display parameter value according to the service identifier and the client screen display parameter value, wherein the service registration information includes a configuration file name and a relative path of the configuration file;

[0097] The configuration file is obtained according to the configuration file name and the relative path.

[0098] Preferably, the client screen display parameter value may correspond to the configuration file name, and the service identifier may correspond to the relative path.

[0099] S205: Rendering the business user interface according to the layout parameter value of the business user interface to generate the corresponding business user interface.

[0100] The business user interface is rendered according to the layout parameter values ​​of the generated business user interface. The specific steps and application scenarios for generating the corresponding business user interface are the same as the specific steps and application scenarios for calling the generated configuration file to generate the corresponding business user interface in the above-mentioned embodiment of the specification, and will not be repeated here.

[0101] After the configuration file is loaded into the client cache, the process further includes rendering a business user interface according to the configuration file sent from the server to generate a corresponding business user interface, specifically including:

[0102] Query the configuration file in the client cache according to the relative path and the element layout attribute;

[0103] Obtaining the element layout attribute value corresponding to the element layout attribute;

[0104] The business user interface is rendered according to the element layout attribute value to generate a corresponding business user interface.

[0105] Preferably, before rendering the business user interface according to the layout parameter value of the business user interface and generating the corresponding business user interface, the method further includes:

[0106] Determine whether the configuration file on the server is updated;

[0107] If so, the updated configuration file is sent from the server to the client.

[0108] If the client sends an updated configuration file, the business user interface is rendered according to the updated configuration file to generate a corresponding business user interface. The specific rendering operation is the same as the rendering step in the above-mentioned embodiment of the specification, and will not be repeated here.

[0109] This method provides a configuration file of a business user interface adapted to different client display parameter values ​​on the server for the client to download, which is convenient for users to use and can reduce the memory occupied by the configuration file on the client. For example, when a new client appears on the market, a configuration file adapted to the new client will be configured on the server. When there is no configuration file for the new client on the application APP, in addition to generating a configuration file adapted to the new client, the adapted configuration file can also be directly sent down through the server. For example, for the skin-changing function of the application APP, if all the skins of the application APP are loaded into the client, a large amount of memory will be occupied. By placing the configuration file of the skin of the application APP on the server, the configuration file of the required skin can be downloaded according to the response of the application APP.

[0110] It can be seen from the above-mentioned embodiments of the specification that the difference between generating a business user interface according to a configuration file sent down according to the client screen display parameter value and generating a business user interface according to a configuration file generated according to the client screen display parameter value is that, on the one hand, before sending the configuration file, it is necessary to check the configuration file on the server to determine whether the server is configured with a configuration file adapted to the current client screen display parameter value, and in addition, it is necessary to determine whether the current client can access the server to determine whether the communication connection between the current client and the server is normal. If the check result of any of the above situations is no, then generate an adapted configuration file according to the current client display parameter value or call the preset configuration file to generate the corresponding business user interface;

[0111] On the other hand, before rendering the business user interface according to the issued configuration file, it is also necessary to monitor whether the configuration file on the server that adapts to the current client screen display parameter values ​​is updated. If so, download and update the configuration file in the client cache, and then render and generate the corresponding business user interface according to the updated configuration file.

[0112] Preferably, there is a certain probability of error in the process of reading the configuration file for client screen adaptation. When an error occurs, the preset configuration file is filled, and the generated element layout attribute values ​​or the issued element layout attribute values ​​are replaced by the preset element layout attribute values, and the client screen is re-adapted to avoid interruptions in the client screen adaptation process.

[0113] It should be noted that the above-mentioned error probability is as small as one in ten thousand, and the default element layout attribute value is a universal value, and the difference between the element layout attribute value adapted to the current client screen display parameter value is small. Therefore, even if an error occurs, the client screen adaptation is performed by filling in the preset configuration file, and there will be no distortion of the business user interface view.

[0114] The above is a client screen adaptation method provided by the embodiment of this specification. Based on the same idea, the embodiment of this specification also provides a corresponding client screen adaptation device, such as Figure 3 shown.

[0115] Figure 3 A schematic diagram of a client screen adaptation device provided in an embodiment of this specification, specifically comprising

[0116] Detection module 301, detecting the client screen display parameter value;

[0117] A judgment module 303 is used to judge whether the client screen display parameter value is compatible with the preset layout parameter value of the business user interface;

[0118] The layout parameter value generating module 305 generates a layout parameter value of an adapted business user interface according to the client display parameter value if the judgment result of the judging module 303 is no;

[0119] Generating the adapted layout parameter value of the service user interface according to the client display parameter value specifically includes:

[0120] A key attribute generation unit determines at least one element layout attribute from a layout element of the business user interface;

[0121] The attribute value generating unit generates, according to the client display parameter value, an element layout attribute value corresponding to each element layout attribute.

[0122] A file generating module 307 generates a configuration file according to the correspondence between the business identifier and the layout parameter value of the generated business user interface;

[0123] The rendering module 309 renders the business user interface according to the generated configuration file to generate a corresponding business user interface.

[0124] Rendering the business user interface according to the generated configuration file to generate a corresponding business user interface specifically includes:

[0125] Determining the location of the configuration file according to the identifier of the service;

[0126] Acquire the element layout attribute value corresponding to the element layout attribute from the configuration file;

[0127] The business user interface is rendered according to the element layout attribute value to generate a corresponding business user interface.

[0128] Based on the same idea, the embodiment of this specification also provides a client screen adaptation device, such as Figure 4 shown.

[0129] Figure 4 A schematic diagram of a client screen adaptation device provided in an embodiment of this specification, specifically comprising

[0130] The receiving module 401 receives a service request, wherein the service request includes a service identifier and a client screen display parameter value;

[0131] A query module 403 queries a configuration file according to the identifier of the service and the client screen display parameter value, wherein the configuration file includes a layout parameter value of a service user interface corresponding to the identifier of the service, and the layout parameter value of the service user interface is generated according to the client display parameter value when the degree of compatibility between the client screen display parameter value and the preset layout parameter value of the service user interface is no;

[0132] The rendering module 405 renders the business user interface according to the layout parameter values ​​of the business user interface to generate the business user interface.

[0133] Preferably, the device further comprises a registration unit, which acquires service registration information corresponding to the service identifier according to the service identifier, wherein the service registration information comprises a configuration file name and a relative path of the configuration file;

[0134] The configuration file is obtained according to the configuration file name and the relative path.

[0135] Preferably, before rendering the business user interface according to the layout parameter value of the business user interface and generating the corresponding business user interface, the method further includes:

[0136] Determine whether the configuration file on the server that is adapted to the screen display parameter value of the client is updated;

[0137] If so, the updated configuration file is sent from the server to the client.

[0138] According to the above description, the embodiment of this specification also provides an actual application scenario, wherein when the client screen rotates, that is, from a vertical screen state to a horizontal screen state, the business user interface needs to be dynamically adapted. Figure 5 A timing diagram of generating a service user interface according to a configuration file generated according to a client screen display parameter value in a client screen adaptation method and device provided in an embodiment of this specification;

[0139] When the detection module detects that the display parameter value of the current client screen has changed, the application APP detects that the client screen has rotated, and the business sends a business request to the file generation module. The file generation module generates a configuration file adapted to the horizontal screen according to the business request, and then the rendering module generates a business user interface in the horizontal state according to the configuration file.

[0140] Generating a business user interface in a horizontal screen state according to the configuration file specifically comprises the following steps:

[0141] S51: The receiving module receives a service request, where the service request includes a service identifier;

[0142] S53: Obtaining a configuration file according to the identifier of the service, specifically including:

[0143] S531: When the service user interface rotates, the registration unit determines corresponding service registration information according to the service identifier, wherein the service registration information includes a configuration file name and a relative path corresponding to the configuration file;

[0144] S533: The file management unit obtains the file path of the configuration file according to the relative path;

[0145] S535: The file management unit loads the configuration file under the file path into the cache management unit;

[0146] S55: The rendering module generates a corresponding business user interface according to the configuration file in the cache management unit, specifically including:

[0147] S551: loading all subviews in the business user interface into the memory, triggering the rendering module to perform layout drawing, and the rendering module queries the business user interface layout parameter value in the configuration file according to the relative path and element layout attributes;

[0148] S553: ​​The rendering module obtains an element layout attribute value corresponding to the element layout attribute according to the relative path and the element layout attribute;

[0149] S555: The rendering module renders the business user interface according to the element layout attribute value to generate a corresponding business user interface.

[0150] In the above application scenario, Figure 6 In a client screen adaptation method and device provided in an embodiment of this specification, a timing diagram of generating a service user interface according to a configuration file sent according to a client screen display parameter value.

[0151] When the detection module detects that the current client screen display parameter value has changed, the application APP detects that the client screen has rotated, sends a service request to the server, and the server sends an adapted configuration file. The rendering module generates a corresponding service user interface according to the configuration file, which specifically includes the following steps:

[0152] S61: When the service user interface rotates, the registration unit queries the server according to the client screen display parameter value and the service identifier whether a configuration file adapted to the client screen display parameter value is configured;

[0153] S63: If yes, sending the configuration file from the server to the file management unit;

[0154] S65: Loading the configuration file into the cache management unit;

[0155] The rendering module renders the business user interface according to the configuration file in the cache management unit to generate a corresponding business user interface. The specific steps are the same as the above steps S551 to S555 and will not be repeated here.

[0156] The above steps S61 to S65 are the process in which the registration unit actively pulls the configuration file adapted to the client screen display parameter value from the server when the service is initialized, and when the configuration file adapted to the client screen display parameter value on the server is updated, the update will be actively pushed to the registration unit on the client. The specific steps are as follows:

[0157] S67: The registration unit receives a callback for updating a configuration file on the monitoring server, where the configuration file is a configuration file adapted to the screen display parameter value of the client;

[0158] S69: The server sends the updated configuration file to the file management unit;

[0159] S611: When the service is triggered to start again, the file management unit updates the configuration file in the cache management unit;

[0160] The rendering module renders the business user interface according to the updated layout parameter value of the business user interface to generate the corresponding business user interface. The specific steps are the same as the above steps S551 to S555 and will not be repeated here.

[0161] After the service is registered, the registration unit will actively listen to the configuration file on the server that is adapted to the service. If the configuration file is updated on the server, when the registration unit receives the monitoring callback, the server will send the updated configuration file to the file management unit. The next time the service is started, the file management unit updates the configuration file in the cache management unit, and the rendering module renders according to the updated configuration file in the cache management unit to generate the corresponding service user interface.

[0162] Preferably, when adapting the service user interface, the configuration file sent from the server is preferentially called, that is, the priority of the configuration file sent by the server is higher than the priority of the configuration file generated in the client.

[0163] Figure 7 A service access flow chart of a client screen adaptation method provided in an embodiment of the present specification. When performing client screen adaptation, service access includes service registration information and a configuration file. The service registration information includes a relative path and a configuration file name. The configuration file may be an adapted configuration file generated according to a client display parameter value. The configuration file may also be a configuration file issued by a server and adapted to the client display parameter value.

[0164] Specifically, for the view width of the member service user interface of the application APP, in the configuration file generation stage, "MENBER_ICON_WIDTH" is first generated as the preset element layout key attribute, that is, the preset key value, and "18" is correspondingly generated as the preset value corresponding to the preset key value, and the preset layout parameter value is generated, that is,

[0165] "MENBER_ICON_WIDTH" = "18"; / / Member view width

[0166] Then generate BarcodeViewLayout.strings under the file path such as BeeXX.bundle, which is the preset configuration file.

[0167] On a client with a screen physical size of 414*812 (screen width*screen height, in millimeters, the same below), the above preset value is not suitable. An adapted layout parameter value can be generated according to the display parameter value of the client, that is,

[0168] "MENBER_ICON_WIDTH" = "21"; / / Member view width

[0169] Then generate BarcodeViewLayout_414_812.strings under the file path BeeXX.bundle, which is the configuration file adapted to the client.

[0170] On the same type of clients with a screen width of 414, in order to adapt to all such clients, the above preset value needs to be configured a little larger, and the adapted layout parameter value can be generated according to the display parameter value of such clients, that is,

[0171] "MENBER_ICON_WIDTH" = "19.5"; / / Member view width

[0172] At the same time, BarcodeViewLayout_414.strings is generated under the file path BeeXX.bundle, which is a configuration file adapted to this type of client.

[0173] When registering business registration information, the registration unit registers the business registration information by calling the following method, as follows:

[0174] -(void)viewDidLoad{

[0175] -[super viewDidLoad];

[0176] -[self setAUThemeName:@"Layout / BarcodeViewLayout.strings"bunldeName:@"BeeXX"];}

[0177] The cache management unit loads the configuration file and its content adapted to the display parameter value of the current client in the directory Layout under the path name "BeeXX" into the cache;

[0178] All subviews in the business user interface are loaded into memory, triggering layout drawing. The client sets the subview layout in the following ways:

[0179] / / Set the width of the member view

[0180] UIImageView*ospmvView=[[UIImageView alloc]init];

[0181] ospmvView.width=__THEME_FLOAT(@"BeeXX",@"MENBER_ICON_WIDTH",18.f);

[0182] The cache management unit searches the cache list for the value corresponding to the key value of the current request based on the path name information "BeeXX" and the element layout attribute, that is, the key value, "MENBER_ICON_WIDTH" passed in by the registration unit. For example, the return value on the client screen with a physical screen size of 414*812 is 21;

[0183] Finally, the user interface rendering unit renders the business user interface according to the acquired value and generates a corresponding business user interface.

[0184] Based on the same inventive concept, an embodiment of this specification further provides an electronic device, including at least one processor and a memory, wherein the memory stores a program and is configured to execute the following steps by the at least one processor:

[0185] Detect the parameter values ​​displayed on the client screen;

[0186] Determining whether the client screen display parameter value is compatible with the preset layout parameter value of the service user interface;

[0187] If not, generating a layout parameter value of an adapted service user interface according to the client display parameter value;

[0188] Generate a configuration file according to the correspondence between the identifier of the service and the generated service user interface layout parameter value;

[0189] The business user interface is rendered according to the generated configuration file to generate a corresponding business user interface.

[0190] Among them, other functions of the processor can also refer to the contents recorded in the above embodiments, which will not be repeated here.

[0191] Based on the same inventive concept, an embodiment of this specification further provides an electronic device, including at least one processor and a memory, wherein the memory stores a program and is configured to execute the following steps by the at least one processor:

[0192] Receiving a service request, wherein the service request includes a service identifier and a client screen display parameter value;

[0193] A configuration file is searched according to the identifier of the service and the client screen display parameter value, wherein the configuration file includes a layout parameter value of a service user interface corresponding to the identifier of the service, and the layout parameter value of the service user interface is generated according to the client screen display parameter value when the degree of compatibility between the client screen display parameter value and the preset layout parameter value of the service user interface is no;

[0194] The business user interface is rendered according to the layout parameter value of the business user interface to generate the corresponding business user interface.

[0195] Among them, other functions of the processor can also refer to the contents recorded in the above embodiments, which will not be repeated here.

[0196] Based on the same inventive concept, the embodiment of this specification also provides a computer-readable storage medium, including a program used in combination with an electronic device, and the program can be executed by a processor to complete the following steps:

[0197] Detect the parameter values ​​displayed on the client screen;

[0198] Determining whether the client screen display parameter value is compatible with the preset layout parameter value of the service user interface;

[0199] If not, generating a layout parameter value of an adapted service user interface according to the client display parameter value;

[0200] Generate a configuration file according to the correspondence between the identifier of the service and the generated service user interface layout parameter value;

[0201] The business user interface is rendered according to the generated configuration file to generate a corresponding business user interface.

[0202] Among them, other functions of the processor can also refer to the contents recorded in the above embodiments, which will not be repeated here.

[0203] Based on the same inventive concept, the embodiment of this specification also provides a computer-readable storage medium, including a program used in combination with an electronic device, and the program can be executed by a processor to complete the following steps:

[0204] Receiving a service request, wherein the service request includes a service identifier and a client screen display parameter value;

[0205] A configuration file is searched according to the identifier of the service and the client screen display parameter value, wherein the configuration file includes a layout parameter value of a service user interface corresponding to the identifier of the service, and the layout parameter value of the service user interface is generated according to the client screen display parameter value when the degree of compatibility between the client screen display parameter value and the preset layout parameter value of the service user interface is no;

[0206] The business user interface is rendered according to the layout parameter value of the business user interface to generate the corresponding business user interface.

[0207] Among them, other functions of the processor can also refer to the contents recorded in the above embodiments, which will not be repeated here.

[0208] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0209] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0210] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0211] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0212] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0213] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0214] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0215] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0216] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0217] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0218] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0219] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0220] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0221] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0222] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A client screen adaptation method, include: Get the client screen display parameter value; Determining whether the client screen display parameter value is compatible with the preset layout parameter value of the service user interface; If not, generating a layout parameter value of an adapted service user interface according to the client screen display parameter value; Generate a configuration file according to the correspondence between the identifier of the service and the layout parameter value of the generated service user interface; the file format of the configuration file exists in the form of key-value, wherein the key value is the element layout attribute, and the value value is the element layout attribute value corresponding to the element layout attribute; Rendering a business user interface according to the generated configuration file to generate a corresponding business user interface includes: if some layout elements in the business user interface need to be updated, using the element layout attribute values ​​in the configuration file to update the layout parameter values ​​corresponding to the some layout elements.

2. The method according to claim 1, detecting the client screen display parameter value, include: When the business user interface is triggered, the parameter value displayed on the client screen is detected.

3. The method according to claim 1, wherein the client screen display parameter value is determined to be compatible with the preset layout parameter value of the service user interface, specifically: include: Determining an adapted preset client screen display parameter value according to the preset layout parameter value; Determine whether the preset client screen display parameter value is compatible with the client screen display parameter value.

4. The method according to claim 1, rendering a business user interface according to the generated configuration file, generating a corresponding business user interface, specifically include: Determining the location of the configuration file according to the identifier of the service; Acquire the element layout attribute value corresponding to the element layout attribute from the configuration file; The business user interface is rendered according to the element layout attribute value to generate a corresponding business user interface.

5. The method according to claim 1, wherein the business user interface is rendered according to the generated configuration file to generate a corresponding business user interface, specifically include: According to the screen adaptation requirement, the business user interface layout parameter values ​​that need to be updated in the configuration file are updated.

6. The method according to claim 1, wherein the layout parameter value of the adapted service user interface is generated according to the client screen display parameter value, specifically: include: determining at least one element layout attribute from a layout element of the business user interface; According to the client screen display parameter value, an element layout attribute value corresponding to each element layout attribute is generated.

7. The method according to claim 1, wherein the generated service user interface layout parameter value comprises at least one set of key-value combination values.

8. The method according to claim 1, wherein the preset layout parameter value is configured in a corresponding preset configuration file, and the preset configuration file is stored in a preset file path corresponding to the client.

9. A client screen adaptation method, include: Receiving a service request, wherein the service request includes a service identifier and a client screen display parameter value; A configuration file is queried according to the identifier of the service and the client screen display parameter value, wherein the configuration file includes a layout parameter value of a service user interface corresponding to the identifier of the service, and the layout parameter value of the service user interface is generated according to the client screen display parameter value when the adaptation between the client screen display parameter value and the preset layout parameter value of the service user interface is no; the file format of the configuration file exists in the form of key-value, wherein the key value is an element layout attribute, and the value value is an element layout attribute value corresponding to the element layout attribute; Rendering a business user interface according to the layout parameter values ​​of the business user interface to generate the corresponding business user interface includes: if some layout elements need to be updated in the business user interface, using the element layout attribute values ​​in the configuration file to update the layout parameter values ​​corresponding to the some layout elements.

10. The method according to claim 9, wherein the rendering of the business user interface according to the layout parameter value of the business user interface generates the corresponding business user interface, specifically include: According to the screen adaptation requirement, the business user interface layout parameter values ​​that need to be updated in the configuration file are updated.

11. The method according to claim 9, wherein the layout parameter value of the business user interface is generated according to the client screen display parameter value when the adaptation between the client screen display parameter value and the preset layout parameter value of the business user interface is no, specifically include: determining at least one element layout attribute from a layout element of the business user interface; According to the client screen display parameter value, an element layout attribute value corresponding to each element layout attribute is generated.

12. The method according to claim 9, wherein the generated service user interface layout parameter value comprises at least one set of key-value combination values.

13. The method according to claim 9, querying a configuration file according to the identifier of the service and the value of the client screen display parameter, include: Acquire service registration information corresponding to the service identifier and the client screen display parameter value according to the service identifier and the client screen display parameter value, wherein the service registration information includes a configuration file name and a relative path of the configuration file; The configuration file is obtained according to the configuration file name and the relative path.

14. The method according to claim 9, rendering the business user interface according to the layout parameter value of the business user interface, before generating the corresponding business user interface, further comprising: include: Determine whether the configuration file on the server that is adapted to the screen display parameter value of the client is updated; If so, the updated configuration file is sent from the server to the client.

15. The method according to claim 9, further comprising: include: querying the server according to the identifier of the service whether a configuration file corresponding to the identifier of the service is configured; If yes, the configuration file adapted to the screen display parameter value of the client is sent from the server; Load the configuration file into the client cache.

16. The method according to claim 15, further comprising: after loading the configuration file into the client cache, include: The business user interface is rendered according to the configuration file sent from the server to generate a corresponding business user interface.

17. The method according to claim 16, wherein the rendering of the business user interface according to the configuration file sent from the server generates a corresponding business user interface, specifically include: Querying the configuration file in the client cache according to the relative path of the configuration file and the element layout attribute; Obtaining the element layout attribute value corresponding to the element layout attribute; The business user interface is rendered according to the element layout attribute value to generate a corresponding business user interface.

18. The method according to claim 16, before rendering the service user interface according to the issued configuration file, further comprising: include: Monitor whether a configuration file adapted to the current client screen display parameter value is updated on the server, and if so, download and update the configuration file in the client cache; The corresponding business user interface is generated by rendering according to the updated configuration file.

19. A client screen adaptation device, include: Get module, get the client screen display parameter value; A judgment module, judging whether the client screen display parameter value is compatible with the preset layout parameter value of the business user interface; a layout parameter value generating module, which generates a layout parameter value of an adapted service user interface according to the client screen display parameter value if the judgment result of the judgment module is no; A file generation module generates a configuration file according to the correspondence between the business identifier and the layout parameter value of the generated business user interface; the file format of the configuration file exists in the form of key-value, wherein the key value is the element layout attribute, and the value value is the element layout attribute value corresponding to the element layout attribute; The rendering module renders the business user interface according to the generated configuration file to generate a corresponding business user interface, including: if some layout elements need to be updated in the business user interface, the layout parameter values ​​corresponding to the some layout elements are updated using the element layout attribute values ​​in the configuration file.

20. A client screen adaptation device, include: A receiving module receives a service request, wherein the service request includes a service identifier and a client screen display parameter value; A query module queries a configuration file according to the identifier of the service and the client screen display parameter value, wherein the configuration file contains a layout parameter value of a service user interface corresponding to the identifier of the service, and the layout parameter value of the service user interface is generated according to the client screen display parameter value when the degree of adaptability between the client screen display parameter value and the preset layout parameter value of the service user interface is no; the file format of the configuration file exists in the form of key-value, wherein the key value is an element layout attribute, and the value value is an element layout attribute value corresponding to the element layout attribute; A rendering module renders a business user interface according to the layout parameter values ​​of the business user interface to generate the business user interface, including: if some layout elements in the business user interface need to be updated, then the layout parameter values ​​corresponding to the some layout elements are updated using the element layout attribute values ​​in the configuration file.

21. An electronic device, include: At least one processor and a memory, wherein the memory stores a program and is configured to execute the following steps by the at least one processor: Get the client screen display parameter value; Determining whether the client screen display parameter value is compatible with the preset layout parameter value of the service user interface; If not, generating a layout parameter value of an adapted service user interface according to the client screen display parameter value; Generate a configuration file according to the correspondence between the identifier of the service and the layout parameter value of the generated service user interface; the file format of the configuration file exists in the form of key-value, wherein the key value is the element layout attribute, and the value value is the element layout attribute value corresponding to the element layout attribute; Rendering a business user interface according to the generated configuration file to generate a corresponding business user interface includes: if some layout elements in the business user interface need to be updated, using the element layout attribute values ​​in the configuration file to update the layout parameter values ​​corresponding to the some layout elements.

22. An electronic device, include: At least one processor and a memory, wherein the memory stores a program and is configured to execute the following steps by the at least one processor: Receiving a service request, wherein the service request includes a service identifier and a client screen display parameter value; A configuration file is queried according to the identifier of the service and the client screen display parameter value, wherein the configuration file includes a layout parameter value of a service user interface corresponding to the identifier of the service, and the layout parameter value of the service user interface is generated according to the client screen display parameter value when the degree of adaptability between the client screen display parameter value and a preset layout parameter value of the service user interface is no; the file format of the configuration file exists in the form of key-value, wherein the key value is an element layout attribute, and the value value is an element layout attribute value corresponding to the element layout attribute; Rendering a business user interface according to the layout parameter values ​​of the business user interface to generate the corresponding business user interface includes: if some layout elements need to be updated in the business user interface, using the element layout attribute values ​​in the configuration file to update the layout parameter values ​​corresponding to the some layout elements.

Citation Information

Patent Citations

  • Adaptation method, device and system for application software interface on terminal equipment

    CN102467331A

  • Layout method and device for client interface, and mobile device

    CN106250158A