Industrial internet application program updating method and device
By regularly obtaining and merging target original icons from the icon library, and automatically updating the access page icons of industrial Internet applications, the poor user experience problem caused by the fixed icons in the existing technology is solved, and the automation and efficiency of icon updates are achieved.
Patent Information
- Application Number
- CN202411748153.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-03-25
AI Technical Summary
The icons of the existing industrial Internet application access pages remain unchanged, resulting in poor user experience and a large amount of work on manually updating the icons.
Provides an industrial Internet application update method, which automatically updates the access page icon by regularly obtaining the target original icon from the icon library, merging the icons, and replacing the original icons in the preset storage location.
实现了访问页面图标的定期自动化更新,提高了用户体验感,并减少了开发和维护的工作量。
Smart Images

Figure CN119690479A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an industrial Internet application updating method and device. Background Art
[0002] Industrial Internet of Things applications refer to applications that use Internet technology to connect industrial equipment, sensors, machines, and other physical assets to collect data, monitor status, optimize operating processes, and improve production efficiency.
[0003] Users can access industrial Internet applications to monitor production processes, manage equipment, manage energy, and manage safety and environment, etc. However, the access pages of existing industrial Internet applications are usually fixed, resulting in poor user experience. Summary of the invention
[0004] The purpose of the present invention is to provide an industrial Internet application updating method and device to achieve regular automatic updating of access page icons and improve user experience.
[0005] In a first aspect, the present invention provides an industrial Internet application updating method, comprising:
[0006] Periodically obtain a target original icon from an icon library corresponding to an industrial Internet application; wherein the icon library includes a fixed icon set that does not change over time and a variable icon set that is updated over time, and the target original icon includes a first icon and a second icon, the first icon comes from the fixed icon set, and the second icon comes from the variable icon set;
[0007] Merge the target original icons to obtain the target merged icon;
[0008] Replace the original merge icon of the preset storage location with the target merge icon so that the target merge icon is loaded when the user accesses the Industrial Internet application.
[0009] Furthermore, the change icon set includes multiple icon subsets; the target original icon is periodically obtained from the icon library corresponding to the industrial Internet application, including:
[0010] When the update time point is reached, one icon is selected from each icon subset in the change icon set as the second icon;
[0011] The second icon and the first icon in the fixed icon set are determined as target original icons.
[0012] Further, selecting one icon from each icon subset in the change icon set as the second icon includes:
[0013] An icon is selected from each icon subset according to preset selection rules to obtain a second icon; wherein the preset selection rules include one or more of a first rule related to chronological order, a second rule corresponding to random selection, and a third rule corresponding to user specification.
[0014] Furthermore, the first rule includes selecting icons with the most recent acquisition time from a first icon subset of the changing icon set, and the icons in the first icon subset are acquired through a preset image acquisition device; the second rule includes randomly selecting icons from a second icon subset of the changing icon set, and the icons in the second icon subset are acquired from an online icon library.
[0015] Further, the target original icons are merged to obtain a target merged icon, including:
[0016] Use the SVGO library to compress the target original icon to obtain a compressed SVG icon;
[0017] The compressed SVG icons are spliced to obtain the target merged icon.
[0018] Furthermore, the compressed SVG icons are spliced to obtain a target merged icon, including:
[0019] Create a new SVG element using the Cheerio library;
[0020] Add each SVG element in the compressed SVG icon to the new SVG element;
[0021] Convert the added new SVG element into a file format to obtain the target merged icon.
[0022] Further, replacing the original merge icon of the preset storage location with the target merge icon includes:
[0023] Determine whether the target merge icon is the same as the original merge icon;
[0024] If no, replace the original merge icon with the target merge icon.
[0025] In a second aspect, the present invention further provides an industrial Internet application updating device, comprising:
[0026] An acquisition module is used to periodically acquire a target original icon from an icon library corresponding to an industrial Internet application; wherein the icon library includes a fixed icon set that does not change over time and a variable icon set that is updated over time, and the target original icon includes a first icon and a second icon, the first icon comes from the fixed icon set, and the second icon comes from the variable icon set;
[0027] A merging module, used for merging the target original icons to obtain a target merged icon;
[0028] A storage module is used to replace the original merged icon of a preset storage location with a target merged icon, so that the target merged icon is loaded when a user accesses an industrial Internet application.
[0029] In a third aspect, the present invention further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the industrial Internet application update method of the first aspect is implemented.
[0030] In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is run by a processor, the industrial Internet application updating method of the first aspect is executed.
[0031] The industrial Internet application updating method and device provided by the present invention can regularly obtain the target original icon from the icon library corresponding to the industrial Internet application; wherein the icon library includes a fixed icon set that does not change with time and a changing icon set that is updated with time, and the target original icon includes a first icon and a second icon, the first icon comes from the fixed icon set, and the second icon comes from the changing icon set; the target original icon is merged to obtain a target merged icon; the original merged icon in the preset storage location is replaced with the target merged icon, so that the target merged icon is loaded when the user accesses the industrial Internet application. In this way, the regular update of the access page icon is realized, and the first icon that the user is accustomed to is retained during the update, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0033] Figure 1 A flowchart of an industrial Internet application updating method provided by an embodiment of the present invention;
[0034] Figure 2 A schematic diagram of a process of merging icons provided by an embodiment of the present invention;
[0035] Figure 3 A schematic diagram of the structure of an industrial Internet application updating device provided by an embodiment of the present invention;
[0036] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0037] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] Icons in web pages are small graphic symbols used for visual communication, and they play an important role in user interface design. Icons can be used to represent functions, operations, status, or content types, etc., to help users quickly understand and identify information and available operations on web pages. At present, the icons displayed on the access page of industrial Internet applications are usually fixed, which can easily cause visual fatigue and poor user experience; and manually updating the icons in industrial Internet applications requires a lot of development and maintenance work. Based on this, an industrial Internet application update method and device provided in an embodiment of the present invention can realize regular automatic update of access page icons and improve user experience.
[0039] To facilitate understanding of this embodiment, an industrial Internet application updating method disclosed in an embodiment of the present invention is first introduced in detail.
[0040] The embodiment of the present invention provides an industrial Internet application update method, which can be executed by an electronic device with image processing capabilities. Figure 1 The flowchart of a method for updating an industrial Internet application program is shown in FIG. 1 , and the method mainly includes the following steps S110 to S130:
[0041] Step S110, regularly obtain the target original icon from the icon library corresponding to the industrial Internet application; wherein the icon library includes a fixed icon set that does not change with time and a changing icon set that is updated with time, and the target original icon includes a first icon and a second icon, the first icon comes from the fixed icon set, and the second icon comes from the changing icon set.
[0042] The above icon library can be stored in a specified directory. You can use the lifecycle hook to obtain all SVG files (i.e., target original icons) that need to be merged by specifying the folder address and / or using a specific suffix name; the suffix name refers to the suffix name of the SVG file, such as .svg.
[0043] In some possible embodiments, the above-mentioned changing icon set may include multiple icon subsets; based on this, the above-mentioned step S110 may include: when the update time point is reached, one icon is selected from each icon subset in the changing icon set as the second icon; the second icon and the first icon in the fixed icon set are determined as the target original icon. Among them, the first icon can be all the icons in the fixed icon set. It should be noted that the update method is not limited to this periodic update method. In other embodiments, the update process of the industrial Internet application can also be manually triggered, that is, when an update instruction is received, the step of obtaining the target original icon from the icon library is executed.
[0044] This embodiment provides multiple selection methods for the second icon, such as selection in chronological order, selection in a random manner, or selection based on manual designation results (such as manually specifying a subset of icons to select a specific icon), etc. Based on this, the second icon can be obtained in the following manner: selecting an icon from each subset of icons according to a preset selection rule to obtain the second icon; wherein the preset selection rule includes one or more of a first rule related to chronological order, a second rule corresponding to random selection, and a third rule corresponding to user designation.
[0045] Optionally, considering that the update mode of the icon subset is different, its selection rules may also be different to improve the rationality of the selected icons. The above-mentioned first rule may include selecting the icon with the latest acquisition time from the first icon subset of the changing icon set, and the icons in the first icon subset are acquired by a preset image acquisition device; the second rule includes randomly selecting icons from the second icon subset of the changing icon set, and the icons in the second icon subset are acquired from the online icon library. Among them, the icons acquired by the image acquisition device are related to the actual factory production line, and may include product images (such as capturing images of products on the production line through a camera for automatic detection of product defects, such as surface scratches, uneven colors, etc.), monitoring images (such as installing cameras to monitor key areas in the factory, including entrances, exits and warehouses, etc.), drone images (such as inspection images), thermal imaging images (such as using thermal imaging cameras to monitor the temperature distribution of equipment, so as to timely discover overheating parts and prevent failures), etc. One or more, so the first icon subset adopts the first rule, which can facilitate users to understand the latest status of the factory production line. The update of the online icon library has nothing to do with the actual production line, so the second icon subset can be used in a random manner.
[0046] Step S120, merging the target original icons to obtain a target merged icon.
[0047] In the development of industrial Internet applications, icons are usually used as image resources. In order to improve the performance of industrial Internet applications, these icons usually need to be merged into a single SVG (Scalable Vector Graphics) icon to reduce the number of HTTP (Hypertext Transfer Protocol) requests. This can solve the problem of long loading time and poor user experience caused by a large number of SVGs in industrial Internet applications, and solve the problem of excessive user traffic consumption caused by a large number of SVG icons.
[0048] Optionally, you can use icon fonts or SVG Symbols to merge the target original icons. Icon fonts are a technology that treats icons as font characters; SVG Symbols allow multiple SVG icons to be defined in a hidden SVG element and then displayed elsewhere on the page. <use>Tags to reference these icons.
[0049] Considering that icon fonts or SVG Symbols may encounter some problems when processing a large number of icons, such as icon overlap, inconsistent sizes, etc. This embodiment provides a more efficient method to merge a large number of icons. Based on this, the above step S120 may include: using the SVGO library to compress the target original icon to obtain a compressed SVG icon; splicing the compressed SVG icons to obtain the target merged icon. Among them, the SVGO (SVG Optimization) library is a tool library based on Node.js, which can be used to optimize SVG graphic files by deleting unnecessary tags, attributes and elements to reduce file size and increase loading speed while maintaining the quality of the graphics. In this way, a large number of SVG icons can be merged efficiently and the high performance of industrial Internet applications can be maintained.
[0050] In a possible implementation, the step of splicing the compressed SVG icons to obtain the target merged icon may include: creating a new SVG element using the Cheerio library; adding each SVG element in the compressed SVG icon to the new SVG element; converting the added new SVG element to a file format to obtain the target merged icon. In this way, all SVG icons can be easily merged into one SVG icon, thereby improving the performance of industrial Internet applications.
[0051] Step S130, replacing the original merge icon in the preset storage location with the target merge icon, so that the target merge icon is loaded when the user accesses the industrial Internet application.
[0052] By storing the target merge icon in a preset storage location and deleting the original merge icon in the preset storage location, the new target merge icon can be used in the industrial Internet application.
[0053] Taking into account that the target merged icon may be the same as the original merged icon in the preset storage location, in order to avoid invalid updates, the above step S130 may include: determining whether the target merged icon is the same as the original merged icon; if not, replacing the original merged icon with the target merged icon; if yes, abandoning this update or re-executing the step of obtaining the target original icon.
[0054] The industrial Internet application updating method provided by the embodiment of the present invention can regularly obtain the target original icon from the icon library corresponding to the industrial Internet application; wherein the icon library includes a fixed icon set that does not change with time and a changing icon set that is updated with time, and the target original icon includes a first icon and a second icon, the first icon comes from the fixed icon set, and the second icon comes from the changing icon set; the target original icons are merged to obtain a target merged icon; the original merged icon in the preset storage location is replaced with the target merged icon, so that the target merged icon is loaded when the user accesses the industrial Internet application. In this way, the regular automatic update of the access page icon is realized, and the first icon that the user is accustomed to is retained during the update, thereby improving the user experience.
[0055] For easier understanding, see Figure 2 The flowchart of merging icons shown in the figure can be realized by the following steps:
[0056] Step S210: compress and optimize each SVG file in the target original icon using the SVGO library.
[0057] Each icon in the target original icon is an SVG file. When compressing, the same elements in multiple SVG files can be merged into one element, that is, the repeated elements in multiple SVG files are deleted until only one is left, thereby reducing the file size of the target original icon. Considering that the names of elements in SVG files are subject to standard constraints, compression can be achieved by removing information such as namespaces in SVG files.
[0058] Step S220: Create a new SVG element using the Cheerio library.
[0059] Step S230: Add all optimized SVG elements to the new SVG element.
[0060] When adding SVG elements, you can arrange them in the order in which the files match.
[0061] Step S240, saving the new SVG element as a file to obtain a target merged icon.
[0062] The target merged icon can be output to a specified source file directory (ie, a preset storage location) for use in an HTML document.
[0063] In this way, after the core content of the SVG icon is read out, it is merged into a specified SVG file, thereby achieving the purpose of merging multiple SVG files into a single SVG file.
[0064] Corresponding to the above-mentioned industrial Internet application updating method, the embodiment of the present invention also provides an industrial Internet application updating device. Figure 3 A schematic diagram of the structure of an industrial Internet application updating device is shown, the device comprising:
[0065] The acquisition module 301 is used to periodically acquire a target original icon from an icon library corresponding to an industrial Internet application; wherein the icon library includes a fixed icon set that does not change over time and a variable icon set that is updated over time, and the target original icon includes a first icon and a second icon, the first icon comes from the fixed icon set, and the second icon comes from the variable icon set;
[0066] A merging module 302 is used to merge the target original icons to obtain a target merged icon;
[0067] The storage module 303 is used to replace the original merged icon in the preset storage location with the target merged icon, so as to load the target merged icon when the user accesses the industrial Internet application.
[0068] The industrial Internet application updating device provided by the embodiment of the present invention can regularly obtain the target original icon from the icon library corresponding to the industrial Internet application; wherein the icon library includes a fixed icon set that does not change with time and a changing icon set that is updated with time, and the target original icon includes a first icon and a second icon, the first icon comes from the fixed icon set, and the second icon comes from the changing icon set; the target original icons are merged to obtain a target merged icon; the original merged icon in the preset storage location is replaced with the target merged icon, so that the target merged icon is loaded when the user accesses the industrial Internet application. In this way, the regular automatic update of the access page icon is realized, and the first icon that the user is accustomed to is retained during the update, thereby improving the user experience.
[0069] Furthermore, the above-mentioned changing icon set includes multiple icon subsets; the above-mentioned acquisition module 301 is specifically used to: when the update time point is reached, select an icon from each icon subset in the changing icon set as the second icon; determine the second icon and the first icon in the fixed icon set as the target original icon.
[0070] Furthermore, the above-mentioned acquisition module 301 is also used to: select an icon from each icon subset according to a preset selection rule to obtain a second icon; wherein the preset selection rule includes one or more of a first rule related to chronological order, a second rule corresponding to random selection, and a third rule corresponding to user specification.
[0071] Furthermore, the above-mentioned first rule includes selecting icons with the most recent acquisition time from the first icon subset of the changing icon set, and the icons in the first icon subset are acquired through a preset image acquisition device; the second rule includes randomly selecting icons from the second icon subset of the changing icon set, and the icons in the second icon subset are acquired from an online icon library.
[0072] Furthermore, the above-mentioned merging module 302 is specifically used for: compressing the target original icon using the SVGO library to obtain a compressed SVG icon; and splicing the compressed SVG icons to obtain a target merged icon.
[0073] Furthermore, the merging module 302 is further used to: create a new SVG element using the Cheerio library; add each SVG element in the compressed SVG icon to the new SVG element; and convert the added new SVG element into a file format to obtain a target merged icon.
[0074] Furthermore, the storage module 303 is specifically used to: determine whether the target merged icon is the same as the original merged icon; if not, replace the original merged icon with the target merged icon.
[0075] The industrial Internet application update device provided in this embodiment has the same implementation principle and technical effects as those of the aforementioned industrial Internet application update method embodiment. For the sake of brief description, for matters not mentioned in the industrial Internet application update device embodiment, reference may be made to the corresponding content in the aforementioned industrial Internet application update method embodiment.
[0076] like Figure 4 As shown, an electronic device 400 provided by an embodiment of the present invention includes: a processor 401, a memory 402 and a bus, the memory 402 stores a computer program that can be run on the processor 401, when the electronic device 400 is running, the processor 401 and the memory 402 communicate through the bus, and the processor 401 executes the computer program to implement the above-mentioned industrial Internet application update method.
[0077] Specifically, the memory 402 and the processor 401 can be general-purpose memories and processors, which are not specifically limited here.
[0078] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is run by a processor, the industrial Internet application program update method in the previous method embodiment is executed. The computer-readable storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a RAM, a magnetic disk, or an optical disk, etc., various media that can store program codes.
[0079] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.
[0080] In all examples shown and described herein, any specific values should be interpreted as merely exemplary and not as limiting, and thus other examples of the exemplary embodiments may have different values.
[0081] The flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and a part of a module, a program segment or a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0082] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation. For example, 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 communication interfaces, and the indirect coupling or communication connection of devices or modules can be electrical, mechanical or other forms.
[0083] 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 solution of this embodiment.
[0084] In addition, each functional module in each 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.
[0085] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.< / use>
Claims
1. A method for updating an industrial Internet application, characterized in that: include: Periodically obtaining a target original icon from an icon library corresponding to an industrial Internet application; wherein the icon library includes a fixed icon set that does not change over time and a variable icon set that is updated over time, and the target original icon includes a first icon and a second icon, wherein the first icon comes from the fixed icon set, and the second icon comes from the variable icon set; Merging the target original icons to obtain a target merged icon; The original merge icon of the preset storage location is replaced with the target merge icon so that the target merge icon is loaded when the user accesses the industrial Internet application.
2. The method according to claim 1, characterized in that: The change icon set includes a plurality of icon subsets; the periodic acquisition of the target original icon from the icon library corresponding to the industrial Internet application includes: When the update time point is reached, selecting one icon from each of the icon subsets in the change icon set as the second icon; The second icon and the first icon in the fixed icon set are determined as the target original icon.
3. The method according to claim 2, characterized in that The selecting one icon from each of the icon subsets in the change icon set as the second icon includes: An icon is selected from each of the icon subsets according to preset selection rules to obtain the second icon; wherein the preset selection rules include one or more of a first rule related to chronological order, a second rule corresponding to random selection, and a third rule corresponding to user specification.
4. The method according to claim 3, characterized in that The first rule includes selecting an icon with the most recent acquisition time from a first icon subset of the set of changing icons, wherein the icons in the first icon subset are acquired by a preset image acquisition device; The second rule includes randomly selecting icons from a second icon subset of the changing icon set, and the icons in the second icon subset are obtained from an online icon library.
5. The method according to claim 1, characterized in that The step of merging the target original icons to obtain a target merged icon includes: Compress the target original icon using the SVGO library to obtain a compressed SVG icon; The compressed SVG icons are spliced to obtain the target merged icon.
6. The method according to claim 5, characterized in that The step of splicing the compressed SVG icons to obtain the target merged icon includes: Create a new SVG element using the Cheerio library; Adding each SVG element in the compressed SVG icon to the new SVG element; The added new SVG element is converted into a file format to obtain the target merged icon.
7. The method according to claim 1, characterized in that The replacing the original merged icon in the preset storage location with the target merged icon includes: Determine whether the target merged icon is the same as the original merged icon; If not, the original merge icon is replaced with the target merge icon.
8. An industrial Internet application updating device, characterized in that: include: An acquisition module, used for periodically acquiring a target original icon from an icon library corresponding to an industrial Internet application; wherein the icon library includes a fixed icon set that does not change over time and a variable icon set that is updated over time, and the target original icon includes a first icon and a second icon, wherein the first icon comes from the fixed icon set, and the second icon comes from the variable icon set; A merging module, used for merging the target original icons to obtain a target merged icon; A storage module is used to replace the original merged icon in a preset storage location with the target merged icon, so as to load the target merged icon when the user accesses the industrial Internet application.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the computer program, the industrial Internet application updating method described in any one of claims 1-7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the industrial Internet application updating method described in any one of claims 1 to 7 is executed.