User interface updating method of electronic equipment, electronic equipment and readable storage medium
By pre-storing display templates with control attributes and content data, the method addresses the inefficiencies in user interface updates by reducing data transmission and enabling local rendering, thus enhancing interaction efficiency and simplifying maintenance.
Patent Information
- Application Number
- CN202410970460.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-12-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing methods for updating user interfaces in electronic devices face challenges in accommodating diverse user needs, requiring extensive firmware adjustments and large data transmission, especially in scenarios with frequent interface changes, leading to inefficiencies in program upgrades and maintenance.
The method involves pre-storing multiple display templates with control attributes and content data on the electronic device, allowing for dynamic updates based on update instructions that only transmit changed content, reducing data volume and simplifying interface adjustments.
This approach speeds up user interface updates, reduces communication data, conserves power, and enhances interaction efficiency by allowing local rendering and independent device operation, thereby simplifying development and maintenance.
Smart Images

Figure CN119105828A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of electronic equipment, and in particular relates to a method for updating a user interface of an electronic equipment, the electronic equipment and a readable storage medium. Background Art
[0002] For electronic devices with display screens, various information can be displayed to users through the display screen. The user interaction interface of the device is usually used to display relevant information, interact with users and other related functions. In addition to commonly used controls such as text, buttons, and pictures, there are usually some decorative lines, boxes, etc. The user interaction interface of the device is composed of the distribution and arrangement of various display controls.
[0003] Different users usually have different requirements for display content and location when using the interface. One interface display cannot meet the various display needs of customers. However, the display of the interface in the program is fixed, and each change in customer needs involves the adjustment of the interface code. This makes it impossible to unify the firmware of the device. Different customers correspond to different firmware, which brings great difficulties to the upgrade and maintenance of the program.
[0004] Another interface display method is that the device interface is a picture. Every time the device switches the interface or a part of the content in the interface changes, the interface is updated by sending a new picture to cover the original display picture. However, this process requires sending a large amount of picture information to update the display. Even if the picture information is transmitted through data compression technology, the data communication volume is still very large. Taking a 300*400 pixel single-color picture as an example, the size of a picture is 300*400 / 8=15000B. Even if 15K data is compressed by 50%, there is still 7KB of data. When this amount of data is used in wireless communication, a large amount of wireless communication time will be occupied. A large amount of information will be sent every time the interface changes. Therefore, it is not suitable for scenarios where the interface changes frequently. It can only be used in scenarios where the interface basically does not change, and it is impossible to interact with the user. Summary of the invention
[0005] An object of the present invention is to provide a method for updating a user interface of an electronic device, an electronic device and a readable storage medium, which can solve the technical problem of difficulty in upgrading programs of electronic devices in the prior art.
[0006] According to a first aspect of the present invention, a method for updating a user interface of an electronic device is provided. The method is applied to an electronic device, wherein the electronic device pre-stores a plurality of display templates, each of which includes control attributes and control content data. The method includes:
[0007] Receive a first update instruction sent by the server, where the first update instruction includes data to be changed;
[0008] In response to the first update instruction, determining a first target display template corresponding to the data to be changed;
[0009] The first target display template is updated according to the data to be changed.
[0010] Optionally, the data to be changed includes a first template identifier, a first control identifier, and control data to be changed;
[0011] The determining of the target display template corresponding to the data to be changed includes:
[0012] Determine the first target display template corresponding to the first template identifier from a plurality of display templates pre-stored in the electronic device;
[0013] The updating of the first target display template according to the data to be changed includes:
[0014] Determine a first target control corresponding to the first control identifier in the first target display template;
[0015] The first target control is updated according to the control data to be changed.
[0016] Optionally, the control data to be changed is a control attribute, and updating the first target control according to the control data to be changed includes:
[0017] The property of the first target control corresponding to the control data to be changed is updated according to the data to be changed.
[0018] Optionally, the control data to be changed is control content data, and updating the first target control according to the control data to be changed includes:
[0019] The content data of the first target control is updated according to the control data to be changed.
[0020] Optionally, the determining a first target control corresponding to the first control identifier in the first target display template includes:
[0021] Parsing the first target display template according to a predefined template protocol to obtain all controls included in the first target display template and corresponding control identifiers;
[0022] The first target control is determined from all controls included in the first target display template according to the first control identifier, and the control identifier of the first target control is the first control identifier.
[0023] Optionally, the method further comprises:
[0024] receiving a second update instruction, wherein the second update instruction includes a second template identifier;
[0025] In response to the second update instruction, determining a second target display template corresponding to the second template identifier from a plurality of display templates pre-stored in the electronic device;
[0026] Switch to display the second target display template.
[0027] Optionally, the display template is stored in a hexadecimal format, and the data to be changed is data in a hexadecimal format.
[0028] According to a second aspect of the present invention, there is provided an electronic device comprising a processor and a memory, wherein the memory stores programs or instructions executable by the processor, and when the programs or instructions are executed by the processor, the steps of a method for updating a user interface of an electronic device as described in the first aspect of the present invention are implemented.
[0029] According to a third aspect of the present invention, a readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of a method for updating a user interface of an electronic device as described in the first aspect of the present invention are implemented.
[0030] The present invention sets a display template, and only needs to send the changed content information when changing the displayed content, which reduces the amount of communication data, so that the electronic device can quickly receive the displayed content and update it, thereby speeding up the feedback process of user information and making the interaction between the electronic device and the user smoother. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 The present invention is a flowchart of a method for updating a user interface of an electronic device according to an embodiment of the present invention.
[0032] Figure 2 It is a schematic diagram of a display interface of an electronic device in an embodiment of the present invention.
[0033] Figure 3 is a schematic diagram of another display interface of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0034] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless otherwise specifically stated.
[0035] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
[0036] The techniques, methods and devices known to those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, the techniques, methods and devices should be considered as part of the specification. In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0037] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0038] In the specification and claims of the present invention, if the term "first" or "second" is involved, it may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "plurality" means two or more. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally means that the related objects are in an "or" relationship.
[0039] This embodiment introduces a method for updating a user interface of an electronic device. The method is applied to an electronic device. The electronic device pre-stores multiple sets of display templates. Each set of the display templates includes control attributes and control content data.
[0040] A set of display templates can contain multiple controls, and each control has its own control properties. Control properties include public properties and unique properties. Public properties are properties that different controls have, such as control ID (Identity document), control type, X-axis start coordinate, Y-axis start coordinate, X-axis end coordinate, and Y-axis end coordinate. Unique properties are properties that are unique to each control, such as the unique properties of the straight line control include line color properties, the unique properties of the text control include font properties, the unique properties of the box control include border color properties and fill properties, and the unique properties of the QR code control include size properties. The control content data represents the content displayed in the control. For example, the content data of the box control can be the text displayed in the box control, and the content data of the QR code control is the QR code.
[0041] Multiple sets of display templates are pre-stored in the electronic device, and different display templates have different control properties and control content data. Users can choose the corresponding display template according to their preferences. The server can send the display template to the electronic device through instructions and store the display template locally in the electronic device.
[0042] like Figure 1As shown, a method for updating a user interface of an electronic device includes steps 1100-1300.
[0043] Step 1100: Receive a first update instruction sent by a server, where the first update instruction includes data to be changed.
[0044] When the display template of the electronic device needs to be updated, the server sends the content to be updated to the electronic device. In this embodiment, wireless communication can be performed between the electronic device and the server, and the server sends the content to be updated to the electronic device via wireless communication. The data to be changed in the first update instruction is the content to be updated.
[0045] The data to be changed may be a control attribute. For example, a display template includes a straight line control. When the line color attribute of the straight line control needs to be changed, the line color to be changed is included in the first update instruction. On the other hand, multiple control attributes may be updated, multiple control attributes of one control may be updated, or multiple control attributes of multiple controls may be updated.
[0046] The data to be changed may also be the content of the control data. When the data to be changed is the property of the control, the property of the control in the display template is updated. According to actual needs, multiple control properties may be updated, or the control content data of multiple controls may be updated.
[0047] Step 1200: In response to the first update instruction, determine a first target display template corresponding to the data to be changed.
[0048] The first target display template is a display template that needs to be changed. After receiving the first update instruction, the electronic device determines which display template needs to be updated.
[0049] Step 1300: Update the first target display template according to the data to be changed.
[0050] Since the display template is dynamically changeable, when the customer changes the interface display, the display template can be updated to meet the needs of different display interfaces. This greatly simplifies the debugging work of interface development. The program does not need to re-adapt the display interface every time, and the firmware of the electronic device is only one, which greatly reduces the difficulty of program development and maintenance.
[0051] Changes to the content of interface controls usually involve only a dozen bytes of information. When changing the displayed content, only the changed content information needs to be sent, which reduces the amount of communication data and enables the device to quickly receive and update the displayed content. This speeds up the feedback process of user information and makes the interaction between the display device and the user smoother.
[0052] The amount of information in the display template varies according to the number of controls. The data volume of a control is about 16 bytes. Usually, there are about 10 controls on the interface, so the data volume of a template is 160 bytes. Compared with the picture display method, the data is reduced by about 40 times. And the display template only needs to be sent once, and the electronic device will permanently save the display template in the internal memory, saving the communication resources of the electronic device. The electronic device in the present invention is a wireless display device, which is usually battery-powered. The smaller data communication volume and communication frequency can save the power of the electronic device and make the electronic device work longer.
[0053] In this embodiment, the data to be changed includes a first template identifier, a first control identifier, and control data to be changed. The step 1200 includes: determining the first target display template corresponding to the first template identifier from a plurality of display templates pre-stored in the electronic device.
[0054] The first template identifier is the identifier of the display template that needs to be changed. For multiple sets of display templates pre-stored in the electronic device, each set of display templates has its own identifier. After the electronic device obtains the first template identifier, it determines the first target display template according to the first template identifier. The electronic device can query from the multiple sets of display templates pre-stored according to the first template identifier to find the first target display template, and the identifier of the first target display template is the first template identifier.
[0055] For example, the electronic device pre-stores 5 sets of display templates, namely display template 1, display template 2, display template 3, display template 4 and display template 5, and the identifiers of the above 5 sets of display templates are identifier 1, identifier 2, identifier 3, identifier 4 and identifier 5. The first template identifier received by the electronic device is identifier 3, and the display template corresponding to identifier 3 is obtained through query as display template 3, so display template 3 is used as the first target display template.
[0056] The step 1300 includes steps 1310 - 1320 .
[0057] Step 1310: Determine a first target control corresponding to the first control identifier in the first target display template.
[0058] The data to be changed also includes a first control identifier. The first control identifier indicates the identifier of the control that needs to be changed. A set of display templates includes multiple controls, each of which has its own identifier, and the control identifier is also the control ID. After the electronic device obtains the first control identifier, it determines the first target control from the multiple controls included in the first target display template, and the identifier of the first target control is the first control identifier.
[0059] Step 1320: Update the first target control according to the control data to be changed.
[0060] The control data to be changed may be control attributes or control content data.
[0061] In this embodiment, the control data to be changed is a control attribute, which can be a common attribute of the control or a specific attribute of the control. The step 1320 includes: updating the attribute of the first target control corresponding to the control data to be changed according to the control data to be changed.
[0062] When the control data to be changed is a control property, the control property of the first target control is updated according to the control data to be changed. For example, if the first target control is a box control, the control property of the box control includes a border color, and the control data to be changed is red, then the border color of the box control is changed to red according to the control data to be changed.
[0063] In this embodiment, the control data to be changed is control content data, and the step 1320 includes: updating the content data of the first target control according to the control data to be changed.
[0064] When the control data to be changed is the control content data, it means that the content displayed in the control needs to be changed without changing the control. Figure 2 As shown in the figure, the text "Dynamic content update" is displayed in a box control, and the control content data is "Update my content". Figure 3 As shown, after the electronic device obtains the control data to be changed, it replaces the content displayed in the box control with "Update My Content".
[0065] In this embodiment, the step 1310 includes: parsing the first target display template according to a predefined template protocol to obtain all controls included in the first target display template and corresponding control identifiers; determining the first target control from all controls included in the first target display template according to the first control identifier, and the control identifier corresponding to the first target control is the first control identifier.
[0066] The template protocol is pre-stored in the electronic device, and the template protocol specifies the data structure of the display template. By parsing the display template through the template protocol, relevant information of each control in the display template and relevant information of the display content in the control can be obtained.
[0067] When an electronic device needs to display a certain display template, it parses the display template through the template protocol to obtain the control properties and control content data of each control contained in the display template. The electronic device renders the control locally based on the parsing results, without relying on the server. The electronic device itself has the various properties of the control, which makes various interactions possible, so that the device can interact with the control locally. And update the requirement to upload the interactive information to the server, so that the device can work independently from the server, enhance the interactive ability of the device, simplify the device deployment method, and reduce the operating cost.
[0068] In this embodiment, the method also includes: receiving a second update instruction, the second update instruction including a second template identifier; in response to the second update instruction, determining a second target display template corresponding to the second template identifier from multiple sets of display templates pre-stored in the electronic device; and switching to display the second target display template.
[0069] When the content of the display template of the electronic device needs to be updated, the server sends a first update instruction to the electronic device. If the content of the display template does not need to be updated, but the interface currently displayed by the electronic device needs to be switched, then the user can trigger a second update instruction by pressing a button on the electronic device. The second update instruction may include a second template identifier, which is the identifier of the display template that needs to be switched. For example, the template currently displayed by the electronic device is display template 1, and the template currently displayed by the electronic device needs to be switched to display template 2, then the second template identifier is the identifier of display template 2.
[0070] After receiving the second update instruction, the electronic device determines the second display template from the pre-stored multiple sets of display templates, and the identifier of the second display template is the second template identifier in the second update instruction. For example, the electronic device pre-stores 5 sets of display templates, namely display template 1, display template 2, display template 3, display template 4 and display template 5, and the identifiers of the above 5 sets of display templates are identifier 1, identifier 2, identifier 3, identifier 4 and identifier 5. The second template identifier received by the electronic device is identifier 2. Through query, it is obtained that the display template corresponding to identifier 2 is display template 2, then display template 2 is used as the second target display template. After determining the second display template, the electronic device displays the content of the second display template.
[0071] In another embodiment, multiple sets of display templates stored in the electronic device are sorted in a preset order. When the user needs to switch the display interface, the multiple sets of display templates are displayed in sequence in the preset order by triggering the corresponding button of the electronic device.
[0072] In this embodiment, the display template is stored in hexadecimal format, and the data to be changed is data in hexadecimal format.
[0073] like Figure 2 The hexadecimal interface data length of the display template shown is 97 bytes, as shown below.
[0074] 20005A0000005AE0030011012E0011016D01010101E10000000000009001280 0010400000300E501002C013E0090018600010105E4050008003A0005016400000 0E106000E00AB00FA00DE00010400000400E207002901C6009001600101020100.
[0075] The control content data of the display template includes the top text, barcode content, QR code content, and text in the lower left corner. Figure 2 As shown, the top text is "Display Example (based on template function)", the barcode content is "123456", the QR code content is "1234567890", and the text in the lower left corner is "Dynamic internal space update". The hexadecimal control content data length of this display template is 93 bytes, as shown below.
[0076] 2204E1000029484C54474530343230E698BEE7A4BA44454D4F28E59FBAE4BA8EE6A8A1E69DBFE58A9FE883BDEFBC8 9E501000A31323334353637383930E4050006313233343536E1060012E58AA8E68081E58685E7A9BAE69BB4E696B0.
[0077] When only the text content in the lower left corner needs to be changed, the update data length is 27 bytes, as shown below.
[0078] 2204E10000E1060012E69BB4E696B0E68891E79A84E58685E5AEB9.
[0079] The present invention further reduces the length of data content by storing data in hexadecimal format rather than in JSON (JavaScript Object Notation, JS key-value pair data) and other formatting forms.
[0080] This embodiment introduces an electronic device, including a processor and a memory, wherein the memory stores programs or instructions that can be executed by the processor, and when the program or instructions are executed by the processor, the steps of a user interface updating method of an electronic device described in any embodiment of the present invention are implemented.
[0081] This embodiment introduces a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of a method for updating a user interface of an electronic device as described in any embodiment of the present invention are implemented.
[0082] Although some specific embodiments of the present invention have been described in detail by way of example, it will be appreciated by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It will be appreciated by those skilled in the art that the above embodiments may be modified without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.
[0083] Those of ordinary skill in the art will appreciate that the modules and algorithm steps described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0084] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and equipment can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0085] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0086] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.
[0087] In addition, each functional module in the embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0088] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the energy-saving signal sending / receiving method of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
[0089] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with (but not limited to) technical features with similar functions disclosed in the present application.
[0090] It should be understood that the size of the sequence number of each step in the content of the invention and the embodiments of the present invention does not absolutely mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention. For the purpose of example and description, the foregoing description of the implementation of the present disclosure has been given. The foregoing description is not exhaustive and is not intended to limit the present disclosure to the exact form disclosed. Various deformations and modifications may exist according to the above teachings, or various deformations and modifications may be obtained from the practice of the present disclosure. These embodiments are selected and described to illustrate the principles of the present disclosure and its practical application, so that those skilled in the art can use the present disclosure in various embodiments and various modifications suitable for the specific purpose conceived.
Claims
1. A method for updating a user interface of an electronic device, characterized in that: The method is applied to an electronic device, wherein the electronic device pre-stores a plurality of display templates, each of which includes control attributes and control content data. The method includes: Receive a first update instruction sent by the server, where the first update instruction includes data to be changed; In response to the first update instruction, determining a first target display template corresponding to the data to be changed; The first target display template is updated according to the data to be changed.
2. The method according to claim 1, characterized in that The data to be changed includes a first template identifier, a first control identifier, and control data to be changed; The determining of the target display template corresponding to the data to be changed includes: Determine the first target display template corresponding to the first template identifier from a plurality of display templates pre-stored in the electronic device; The updating of the first target display template according to the data to be changed includes: Determine a first target control corresponding to the first control identifier in the first target display template; The first target control is updated according to the control data to be changed.
3. The method according to claim 2, characterized in that The control data to be changed is a control attribute, and updating the first target control according to the control data to be changed includes: The property of the first target control corresponding to the control data to be changed is updated according to the data to be changed.
4. The method according to claim 2, characterized in that: The control data to be changed is control content data, and updating the first target control according to the control data to be changed includes: The content data of the first target control is updated according to the control data to be changed.
5. The method according to claim 2, characterized in that: The determining a first target control corresponding to the first control identifier in the first target display template includes: Parsing the first target display template according to a predefined template protocol to obtain all controls included in the first target display template and corresponding control identifiers; The first target control is determined from all controls included in the first target display template according to the first control identifier, and the control identifier of the first target control is the first control identifier.
6. The method according to claim 1, characterized in that The method further comprises: receiving a second update instruction, wherein the second update instruction includes a second template identifier; In response to the second update instruction, determining a second target display template corresponding to the second template identifier from a plurality of display templates pre-stored in the electronic device; Switch to display the second target display template.
7. The method according to claim 1, characterized in that The display template is stored in hexadecimal format, and the data to be changed is data in hexadecimal format.
8. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores programs or instructions executable by the processor, and when the programs or instructions are executed by the processor, the steps of a method for updating a user interface of an electronic device as described in any one of claims 1 to 7 are implemented.
9. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the method for updating the user interface of an electronic device as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Mobile terminal application template updating and issuing method and device
CN104077162A
Interface display method and interface display device
CN106775836A
Medical equipment operation page configuration method and device, medical equipment and computer storage medium
CN109741820A
Service interface display method and device of mobile application, terminal and storage medium
CN113377469A
Template updating method and device, storage medium and electronic device
CN116521194A
