CN115509675A - Message generation method and device - Google Patents

Message generation method and device Download PDF

Info

Publication number
CN115509675A
CN115509675A CN202110687396.1A CN202110687396A CN115509675A CN 115509675 A CN115509675 A CN 115509675A CN 202110687396 A CN202110687396 A CN 202110687396A CN 115509675 A CN115509675 A CN 115509675A
Authority
CN
China
Prior art keywords
message
node
client
picture
combination
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110687396.1A
Other languages
Chinese (zh)
Inventor
栾佳
傅宇文
刘心晖
孔大超
耿贤辈
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202110687396.1A priority Critical patent/CN115509675A/en
Priority to PCT/CN2022/094662 priority patent/WO2022267797A1/en
Publication of CN115509675A publication Critical patent/CN115509675A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45529Embedded in an application, e.g. JavaScript in a Web browser
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45554Instruction set architectures of guest OS and hypervisor or native processor differ, e.g. Bochs or VirtualPC on PowerPC MacOS
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/03Protocol definition or specification 

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present application relates to the field of message generation, and in particular, to a method and an apparatus for generating a message displayed on a client. The method comprises the following steps: generating a first message based on a request message of a client, wherein the first message is of a tree structure comprising a plurality of nodes; acquiring a picture corresponding to a first node in the plurality of nodes; replacing the first node in the first message with the picture to generate a second message; and sending the second message to the client. By using the method and the device, the display time of the message requested by the client is reduced, and the user experience of the client is improved.

Description

Message generation method and device
Technical Field
The present application relates to a message generation method, and in particular, to a message generation method and apparatus for displaying on a client.
Background
When a client application program displays a message content file and a JavaScript file (JS for short) acquired from a server, a client firstly runs the JS file to generate a virtual text Object Model (DOM) interface; and analyzing the virtual DOM structure, comparing the virtual DOM structure with a local cache DOM interface to generate a rendering instruction, and converting the virtual DOM interface into a display component according to the rendering instruction so as to display the message.
The number of the elements in the message and the nesting structure in the method influence rendering delay, occupy large memory and influence user experience.
Disclosure of Invention
In view of this, the present application provides a message generating method and apparatus, which can reduce display time and memory usage, and improve user experience.
In order to achieve the above object, a first aspect of the present application provides a message generating method, including: generating a first message based on a request message of a client, wherein the first message is of a tree structure comprising a plurality of nodes; acquiring a picture corresponding to a first node in a plurality of nodes in a first message; replacing a first node in the first message with the picture to generate a second message; and sending the second message to the client.
And replacing the first node with the picture corresponding to the first node in the first message to generate a second message, and sending the second message to the client. Because the second message has a simple structure, the client does not need to perform DOM analysis and display component generation of the complex message when displaying, the resource consumption of the client when displaying the complex message is reduced, and the user experience of the client is improved.
In a possible implementation manner of the first aspect of the present application, when obtaining a picture corresponding to a first node in a first message, the method specifically includes: acquiring the complexity of a first node combination formed by first nodes; and when the complexity is greater than a first threshold value, acquiring a picture corresponding to the first node combination. When the picture is used to replace the first node in the first message to generate the second message, the method specifically includes: and replacing the first node combination in the first message with the corresponding picture to generate a second message.
Therefore, when the complexity of the first node combination is greater than the set threshold, the picture corresponding to the first node combination is used for replacing the first node combination in the first message, so that the message structure is simpler, meanwhile, the picture is prevented from being used for replacing the simple first node combination, the resource consumption of the client during display is further reduced, and the experience of the client is improved.
In one possible implementation of the first aspect of the present application, the first node is a static node whose content is fixed.
Therefore, the first node is limited to be a static node with fixed content, so that the server only acquires the pictures corresponding to the static node or the combination of the static node, and the server resources are reduced.
In a possible implementation manner of the first aspect of the present application, when generating the second packet by replacing the first node in the first packet with the corresponding picture, the method specifically includes: acquiring the category information of a client; determining the number of users corresponding to the type of the client according to the type information; and when the number of the users is larger than a second threshold value, replacing the first node in the first message with the corresponding picture to generate a second message.
Therefore, the number of the user groups of each client type of the first node combination is counted, and when the number of the user groups of one client type exceeds a set threshold value, the picture corresponding to the first node combination is used for replacing the first node combination, so that the resource consumption of the user groups in displaying the first node combination is reduced, and the experience of the clients is improved; meanwhile, the threshold of the number of the user groups is set, so that the server can clear pictures of the number of the users in the server in time, and the resource consumption of the server is reduced.
In one possible implementation of the first aspect of the present application, the category information of the client includes one or more of a client model number, a client operating system version, or a client version.
And determining the type of the client, so that when the first node or the first node combination corresponding picture is obtained, the corresponding picture is obtained according to the type of the client, and the corresponding picture is matched with the client.
In one possible implementation of the first aspect of the present application, the first threshold is determined by: acquiring a plurality of first messages; calculating the difference and the complexity of the resource consumption of a first node combination in a plurality of first messages, wherein the difference is the difference between the resource consumption of the first node combination based on the first message and the resource consumption of the picture corresponding to the first node combination; the first threshold is determined based on the complexity of the plurality of first node combinations and the difference.
Therefore, the first threshold value of the node complexity is determined by the difference value of the complexity and the resource consumption of the plurality of first node combinations, so that when the node combination with high complexity is selected to be replaced by the corresponding picture, an accurate judgment standard is provided.
In a possible implementation of the first aspect of the present application, the resource consumption is determined by one or more of occupied memory and display time of the display node combination.
Therefore, the resource consumption is determined by comprehensively calculating the occupied memory and the display time of the display node combination, the resource consumption is estimated more accurately, and an accurate data basis is provided for determining the first threshold.
In one possible implementation of the first aspect of the present application, the complexity of the node combination is determined based on one or more of the number of node layers, the number of nodes, the node complexity weight, and the occupied pixel area of the node combination.
Therefore, the complexity of the first node combination is comprehensively determined based on the number of node layers, the number of nodes, the type of the nodes and the occupied pixel area, and a basis is provided for accurately judging the first node combination which needs to be replaced by the picture.
In one possible implementation of the first aspect of the present application, the complex weight of a node is determined by a node type in a node combination.
Therefore, the node complexity weight is determined based on the node type, and the node complexity is calculated more accurately.
In order to achieve the above object, a second aspect of the present application provides a message generating apparatus, including: the first message generation module is used for generating a first message based on a request message of a client, wherein the first message is of a tree structure comprising a plurality of nodes; the image acquisition module is used for acquiring an image corresponding to a first node in the plurality of nodes of the first message; the message replacing module is used for replacing a first node in the first message by the corresponding picture to generate a second message; and the message sending module is used for sending the second message to the client.
And replacing the first node with the picture corresponding to the first node in the first message to generate a second message, and sending the second message to the client. Because the second message has a simple structure, the client does not need to perform DOM analysis and display component generation of the complex message when displaying, the resource consumption of the client when displaying the complex message is reduced, and the user experience of the client is improved.
In a possible implementation manner of the second aspect of the present application, the picture obtaining module is specifically configured to obtain a complexity of a first node combination formed by the first nodes; the method further specifically comprises the steps of obtaining a picture corresponding to the first node combination when the complexity is greater than a first threshold; the message replacement module is specifically configured to replace a first node combination in the first message with a picture to generate a second message.
Therefore, when the complexity of the first node combination is greater than the set threshold, the picture corresponding to the first node combination is used for replacing the first node combination in the first message, so that the message structure is simpler, meanwhile, the picture is prevented from being used for replacing the simple first node combination, the resource consumption of the client during display is further reduced, and the experience of the client is improved.
In one possible implementation of the second aspect of the present application, the first node is a static node whose content is fixed.
Therefore, the first node is limited to be a static node with fixed content, so that the server only acquires the pictures corresponding to the static node or the combination of the static node, and the server resources are reduced.
In a possible implementation manner of the second aspect of the present application, the message replacement module is specifically configured to obtain category information of a client; and is also specifically configured to determine, according to the category information of the client, a number of users corresponding to the category of the client; and the second node is further specifically configured to replace the first node in the first message with the corresponding picture to generate a second message when the number of users is greater than the second threshold.
Therefore, the number of the user groups of each client type of the first node combination is counted, and when the number of the user groups of one client type exceeds a set threshold value, the picture corresponding to the first node combination is used for replacing the first node combination, so that the resource consumption of the user groups in displaying the first node combination is reduced, and the experience of the clients is improved; meanwhile, the threshold of the number of the user groups is set, so that the server can clear pictures of the number of the users in the server in time, and the resource consumption of the server is reduced.
In one possible implementation of the second aspect of the present application, the category information of the client includes one or more of a client model number, a client operating system version, or a client version.
And determining the type of the client, so that when the first node or the first node combination corresponding picture is obtained, the corresponding picture is obtained according to the type of the client, and the corresponding picture is matched with the client.
In a possible implementation manner of the second aspect of the present application, the apparatus further includes a first threshold generating device, configured to obtain a plurality of first messages; the system is also used for calculating the difference and complexity of the resource consumption of the first node combination in the plurality of first messages, wherein the difference is the difference between the resource consumption of the first node combination based on the first message and the resource consumption of the corresponding picture; and further for determining the first threshold based on a difference between the complexity and the resource consumption of the plurality of first node combinations.
Therefore, the first threshold value of the node complexity is determined by the difference value of the complexity and the resource consumption of the plurality of first node combinations, so that when the node combination with high complexity is selected to be replaced by the corresponding picture, an accurate judgment standard is provided.
In a possible embodiment of the second aspect of the present application, the resource consumption is determined by one or more of occupied memory and display time of the display node combination.
Therefore, the resource consumption is determined by comprehensively calculating the occupied memory and the display time of the display node combination, the resource consumption is estimated more accurately, and an accurate data basis is provided for determining the first threshold.
In one possible implementation of the second aspect of the present application, the complexity is determined based on one or more of the number of node layers, the number of nodes, the node complexity weight, and the occupied pixel area of the node combination.
Therefore, the complexity of the first node combination is comprehensively determined based on the number of node layers, the number of nodes, the type of the nodes and the occupied pixel area, and a basis is provided for accurately judging the first node combination which needs to be replaced by the picture.
In one possible implementation of the second aspect of the present application, the complex weight of a node is determined by the type of node in the node combination.
Therefore, the node complexity weight is determined based on the node type, and the node complexity is calculated more accurately.
To achieve the above object, a third aspect of the present application provides a computing device comprising a processor and a memory, the memory storing program instructions that, when executed by the processor, cause the processor to perform the message generation method of the first aspect of the present application.
To achieve the above object, a fourth aspect of the present application provides a storage medium having stored thereon program instructions that, when executed by a computer, cause the computer to execute the message generation method of the first aspect of the present application.
To achieve the above object, a fifth aspect of the present application provides a computer program product including program instructions, which when executed by a computer, cause the computer to execute the message generation method of the first aspect of the present application.
Drawings
FIG. 1A is a schematic diagram of an application system according to various embodiments of the present disclosure;
fig. 1B is a schematic diagram of a card display content of a negative screen of a mobile phone according to an embodiment of the present application;
FIG. 2A is a schematic flow chart of a first embodiment of the method of the present application;
fig. 2B is a schematic structural diagram of a first packet of a weather lookup service;
FIG. 3A is a schematic flow chart of a second embodiment of the method of the present application;
fig. 3B is a schematic flowchart of a picture obtaining method according to a second embodiment of the present application;
fig. 4 is a schematic flowchart of an embodiment of a first threshold determination method according to a second embodiment of the present application;
FIG. 5A is a schematic flow chart of a third embodiment of the method of the present application;
fig. 5B is a schematic flowchart of a picture replacement method according to a third embodiment of the present application;
FIG. 6 is a schematic diagram of an embodiment of the apparatus of the present application;
FIG. 7 is a schematic diagram of a second embodiment of the apparatus of the present application;
FIG. 8 is a block diagram of a first threshold determination module that is implemented in accordance with a second embodiment of the present invention;
FIG. 9 is a schematic diagram of a third embodiment of the apparatus of the present application;
FIG. 10A is a schematic flow chart diagram of one embodiment of the present application;
fig. 10B is a schematic diagram of 3 types of first node combinations of the first packet in the embodiment of the present application;
fig. 10C is a schematic diagram illustrating a correspondence relationship between joint key values and pictures in the embodiment of the present application;
fig. 10D is a schematic diagram of first message content in the embodiment of the present application;
fig. 10E is a schematic diagram of second message content in the embodiment of the present application;
fig. 10F is a schematic diagram illustrating display content of a second message according to an embodiment of the present application;
FIG. 11 is a block diagram of an embodiment of a computing device of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
The terms "first, second, third and the like" or "module a, module B, module C and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order, it being understood that specific orders or sequences may be interchanged where permissible to effect embodiments of the present application in other than those illustrated or described herein.
In the following description, reference numbers indicating steps, such as S110, S120 … …, etc., do not necessarily indicate that the steps are executed in this order, and the order of the preceding and following steps may be interchanged or executed simultaneously, if permitted.
The term "comprising" as used in the specification and claims should not be construed as being limited to the contents listed thereafter; it does not exclude other elements or steps. It should therefore be interpreted as specifying the presence of the stated features, integers, steps or components as referred to, but does not preclude the presence or addition of one or more other features, integers, steps or components, and groups thereof. Thus, the expression "an apparatus comprising the devices a and B" should not be limited to an apparatus consisting of only the components a and B.
Reference in the specification to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. Thus, appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment, but may. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments, as would be apparent to one of ordinary skill in the art from this disclosure.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. In the case of inconsistency, the meaning described in the present specification or the meaning derived from the content described in the present specification shall control. In addition, the terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the present application.
The following, first of all, is an analysis of the background art, which has the following disadvantages:
1. in the scheme in the background technology, the steps of DOM analysis and display component generation are required, so the number of elements in the message and the nesting structure influence the rendering time delay;
2. in the steps of DOM analysis and display component generation, the memory occupation is influenced by the operation files, temporary variables, other basic consumption and the like of the messages, and the memory occupation size is positively correlated with the complexity of the message structure.
The embodiment of the application provides a message generation method and device, wherein a message is segmented, and a plurality of segmented contents are replaced by pictures, so that the display time and the memory occupation are reduced, and the user experience is improved.
The method and advantageous technical effects of the method embodiments of the present application are described below based on fig. 1A to 5B.
Fig. 1A shows an application system applied in the embodiment of the present application, which includes a server 1, a client 3, and a network 2. The client 3 may be a mobile terminal such as a mobile phone, a tablet computer, or a computer such as a personal computer, and is configured to display the message content, where the display mode at least includes a web page, an application program, and a card with one screen being set on the mobile phone, and fig. 1B shows a card display mode with one screen being set on the mobile phone. The server 1 is configured to generate a packet based on a packet request of a client, and may be a cloud server, a local server, an entity server, or a virtual server. The network 2 is used for transmitting messages between the server 1 and the client 3, and the network 2 may be a wired network or a wireless network or a mixture of the two.
[ METHOD EXAMPLES ] As a method for producing a semiconductor device
The present embodiment provides a message generation method, which may be executed by the server 1.
In the first method embodiment, the first message is generated based on the message request of the client, and the static node is replaced by the picture corresponding to the static node in the first message, so that the resource consumption of the client 3 during display is reduced, and the experience of the client 3 is improved.
Fig. 2A shows a flow of an embodiment of a method, comprising the steps of:
s210, generating a first message based on the request message of the client 3, wherein the first message is of a tree structure comprising a plurality of nodes.
Wherein the message requested by the client 3 is for display on the client 3. In some embodiments, the client 3 requests a message from the server 1 based on a service, the requested message corresponding to the service content.
Fig. 2B shows an example of a first packet of a weather lookup service, where the left side is a lookup weather content displayed by a client, and the right side is a tree structure of the corresponding first packet. Wherein, the first layer of the first message has 2 nodes, which are a node of the current day (for maininefor in fig. 2B) and a weather prediction node (for weather for example in fig. 2B), respectively corresponding to the weather of the current day and the weather of 5 consecutive days from the previous day of the current day, wherein, the nodes of the current day include time nodes (real time in fig. 2B) and weather nodes of the current day (allday in fig. 2B), which respectively correspond to the specific time when the current day is looked up and the weather of the current day; the weather prediction nodes include 5 day nodes (labeled 0, 1, 2 in fig. 2B, where 3 and 4 are not labeled), respectively corresponding to weather conditions for 5 consecutive days from the day before the query day, each day node including 4 nodes, respectively Date, week, weather, and Temperature nodes (Date, week, url, and Temperature, respectively, in fig. 2B), where the weather nodes are in the form of pictures.
S220, obtaining a picture corresponding to a first node in the multiple nodes of the first message, wherein the first node is a static node with fixed content.
In some embodiments, if all nodes included in a node in the tree structure of the first packet are static nodes, the node is also the first node.
Continuing with fig. 2B as an example, the current-day node corresponds to the specific time when the current day is referred to and the current day, and since the specific time is constantly changing, the time node is not the first node, and the current-day node including the time node is not the first node. On the day of inquiry, the date, the week, the weather and the temperature corresponding to each day node in the weather prediction nodes are all unchanged, so that 4 nodes included in each day node are all first nodes, each day node is also a first node, and the weather prediction node is a first node.
In some embodiments, when the picture corresponding to the first node does not exist, the picture is created.
Wherein, in some embodiments, the adapted picture is further selected based on the type of the client terminal to meet the requirements of different terminals.
Therefore, because the content of the static node is not changed, the corresponding display content at the client 3 is also not changed, so that the static node can be replaced by the picture, and the message structure is simple.
And S230, replacing the first node with the picture corresponding to the first node to generate a second message.
Specifically, a message corresponding to the first node in the first message is replaced with a network address (URL) of a picture corresponding to the first node. And when the client 3 displays the second message, directly acquiring the picture corresponding to the first node based on the URL.
Therefore, the static nodes are replaced by the pictures, so that the message structure is simple, and the client does not need to perform complex DOM analysis and display component generation of the message when displaying.
And S240, sending a second message to the client 3.
In the above way, the static node in the second message is replaced by the picture, the second message has a simple structure, and the DOM parsing and display component generation of the message are not required when the client 3 displays the message.
In summary, in the first embodiment of the method, a first message is generated based on a message request of the client 3, a picture corresponding to a static node in the first message is used to replace the static node, and a second message is generated and sent to the client 3. Because the second message has a simple structure, the DOM analysis and display component generation of the complex message are not required when the client 3 displays the complex message, so that the resource consumption of the client 3 when the complex message is displayed is reduced, and the experience of the client 3 is improved.
[ METHOD EXAMPLE II ]
The present embodiment provides a message generation method, which may be executed by the server 1.
In the second method embodiment, the static nodes are combined on the basis of the first method embodiment, and when the complexity of a node combination composed of a plurality of static nodes in the first message is greater than a set threshold, a picture corresponding to the static node combination is used to replace the static node combination, so that the resource consumption of the client 3 during display is further reduced, and the experience of the client 3 is improved.
Fig. 3A shows a flow of a second method embodiment, which replaces steps 220 and S230 of the first method embodiment with steps S222 and S232, respectively, in comparison to the flow of the first method embodiment, and the following description focuses on the modified steps:
s222, obtaining a picture corresponding to a first node combination in the plurality of nodes of the first message.
In some embodiments, a plurality of static nodes which are adjacent in sequence all belong to the same node directly, and then the plurality of static nodes form a first node combination.
Continuing with fig. 2B as an example, each day node in the weather prediction nodes is the first node and directly belongs to the weather prediction nodes, wherein any several sequentially adjacent day nodes form the first node combination.
In some embodiments, when the complexity of the first node combination is greater than a set threshold, the corresponding picture is obtained.
Specifically, please refer to [ method embodiment two ] for a detailed description of the step.
Therefore, the picture corresponding to the first node combination is obtained, and the first node combination in the first message is replaced in the subsequent steps, so that the message structure is simpler. Meanwhile, when the client 3 displays the simple first node combination in a mode of displaying the corresponding picture, the consumed resources are not reduced greatly, and the picture corresponding to the first node combination is obtained only when the complexity is greater than the set threshold, so that the simple first node combination is prevented from being replaced by the picture.
S232, replacing the first node combination in the first message with the corresponding picture to generate a second message.
By replacing the first node combination with the picture corresponding to the first node combination with the complexity greater than the set threshold, resource consumption of the client 3 during display is further reduced, and experience of the client 3 is improved.
[ Picture acquisition method in method embodiment two ]
The picture acquiring method in the second embodiment of the method acquires the complexity of the first node combination, and acquires the corresponding picture when the complexity of the first node combination is greater than the set threshold value, so that the picture is prevented from replacing the simple first node combination.
Fig. 3B shows a flow of a picture acquiring method according to the second embodiment, which includes the following steps:
s2210, acquiring a first node combination formed by the first nodes and the complexity of the first node combination.
In some embodiments, the complexity of the node combination is determined based on at least the number of node layers, the number of nodes, the complex weight of the node, and the occupied pixel area of the first node combination, and the complexity is increased when the number of node layers is increased or the number of nodes is increased or the occupied pixel area is reduced or the complex weight of the node is significant.
In some embodiments, the node complex weight of the node is determined based on the node type in the first node combination, and the more the picture nodes are, the larger the node complex weight is. A
Specifically, the complexity calculation method of the first node combination refers to [ first threshold determination method embodiment ]
Therefore, the complexity of the first node combination is comprehensively determined based on the number of node layers, the number of nodes, the type of the nodes and the occupied pixel area, and a basis is provided for accurately judging the first node combination which needs to be replaced by the picture.
S2220, when the complexity of the first node combination is larger than a first threshold value, obtaining a picture corresponding to the first node combination.
In some embodiments, when the picture corresponding to the first node combination does not exist, the picture is created.
Wherein, in some embodiments, the adapted picture is further selected based on the type of the client terminal to meet the requirements of different terminals.
Therefore, when the complexity is greater than the set threshold, the picture corresponding to the first node combination is obtained, so that the picture is prevented from being used for replacing the simple first node combination.
[ first threshold determining method embodiment ]
Before describing the present embodiment, the calculation formulas regarding the complexity and resource consumption of the node combinations will be described.
In this embodiment, the resource consumption is determined by one or more of the occupied memory and the display time of the display node combination estimated by the server 1. An example resource consumption calculation formula is as follows:
Figure BDA0003125246280000081
wherein, cost is the resource consumption of the message to be displayed by the client 3; m is a unit of i Displaying the memory occupied by the message to be displayed, m, for the client 3 basic The basic memory occupied for displaying any message to be displayed for the client 3 is related to the display environment of the client 3, is unrelated to the message to be displayed, and m is max For client3 displaying any maximum memory occupied when a message to be displayed is displayed; t is t i Displaying the time taken for the message to be displayed, t, for the client 3 basic The basic time occupied for displaying any message to be displayed for the client 3 is related to the display environment of the client 3, is unrelated to the message to be displayed, and t max The maximum time that can be occupied when any message to be displayed is displayed for the client 3. The message to be displayed is a message corresponding to the node combination, and may be a message corresponding to the node combination in the first message, or may be a picture message corresponding to the node combination.
Fig. 4 shows a flow of an embodiment of the first threshold determination method, which comprises the following steps:
s410, obtaining a plurality of first messages.
Therefore, the plurality of first messages are obtained, so that the resource consumption and complexity samples of various node combinations can be conveniently obtained, and the relation between the resource consumption and the complexity of the node combinations can be accurately analyzed. The first node combination is one of node combinations, and is a combination of static nodes.
And S420, calculating the difference and complexity of the resource consumption of the node combinations in the plurality of first messages, wherein the difference of the resource consumption is the difference between the resource consumption occupied by the node combinations and the resource consumption occupied by displaying the corresponding pictures based on the first message.
In some embodiments, the complexity of the node combination is determined based on one or more of the number of node layers, the number of nodes, the complex weight of the node, and the pixel area occupied by the node combination, and the complex weight of the node is determined by the type of the node in the node combination. An example complexity calculation formula is as follows:
Figure BDA0003125246280000091
wherein f is the complexity of the node combination, h is the number of node layers of the node combination, n is the number of static nodes in the node combination, η is the node complex weight of the node combination, which is determined based on the proportion of image nodes in the node combination, s is the pixel area of the node combination, and k is a set constant.
In some embodiments, the resource consumption is determined by one or more of the occupied memory and the display time of the display node combination estimated by the server 1. An example resource consumption calculation formula is as follows:
Figure BDA0003125246280000092
wherein cost is the resource consumption of the message to be displayed by the client 3; m is i Displaying the memory occupied by the message to be displayed, m, for the client 3 basic The basic memory occupied for displaying any message to be displayed for the client 3 is related to the display environment of the client 3, is unrelated to the message to be displayed, and m is max The maximum memory which can be occupied when any message to be displayed is displayed for the client 3; t is t i Displaying the time taken for the message to be displayed, t, for the client 3 basic The basic time occupied for displaying any message to be displayed for the client 3 is related to the display environment of the client 3, is unrelated to the message to be displayed, and t max The maximum time that can be occupied when any message to be displayed is displayed for the client 3. The message to be displayed is a message corresponding to the node combination, and may be a message corresponding to the node combination in the first message, or may be a picture message corresponding to the node combination.
According to the method, the complexity of the node combination is calculated, the difference value between the resource consumption occupied by the node combination and the resource consumption occupied by the corresponding picture is displayed based on the first message, and accurate data basis is provided for determining the first threshold value of the node complexity.
And S430, determining a first threshold value based on the difference value of the complexity and the resource consumption of each node combination.
Wherein the first threshold is determined in some embodiments by fitting a relationship between the difference in resource consumption and the complexity for a plurality of node combinations. When the complexity of the node combination is greater than a first threshold, the difference of the resource consumption is greater than 0, that is, the resource consumption occupied by the node combination is greater than the resource consumption occupied by displaying the corresponding picture based on the first message.
Therefore, the first threshold of the node complexity is determined by the difference value of the complexity of the plurality of node combinations and the resource consumption amount, so that when the node combination with high complexity is selected to be replaced by the corresponding picture, an accurate judgment standard is provided.
In summary, in the second method embodiment, on the basis of the first method embodiment, when the complexity of the first node combination is greater than the set threshold, the picture corresponding to the first node combination is used to replace the first node combination in the first message, so that the message structure is simpler, and meanwhile, the picture is prevented from being used to replace the simple first node combination, thereby further reducing the resource consumption of the client 3 during displaying, and improving the experience of the client 3.
[ METHOD EXAMPLES III ]
The present embodiment provides a message generation method, which may be executed by the server 1.
Third of the method embodiments, on the basis of the second of the method embodiments, when the number of users of the first node combination exceeds the set threshold, and the picture corresponding to the first node combination is used to replace the first node combination, resource consumption of the user group when the first node combination is displayed is reduced, experience of the client 3 is improved, and resource consumption of the server 1 is reduced.
Fig. 5A shows a flow of a third method embodiment, which replaces step 232 of the second method embodiment with S234, and focuses on the following steps, in comparison with the flow of the second method embodiment:
s234, replacing the first node combination with the corresponding picture based on the number of users of the first node combination in the first message to generate a second message.
In some embodiments, the number of users corresponding to the type of each client 3 is counted based on the type information of the client 3 of the first node combination, and when the number of users exceeds a set second threshold, a picture corresponding to the first node combination is used to replace the first node combination in the first message.
In some embodiments, the corresponding pictures stored in the server for the first node combination are cleaned based on a Least Recently Used (LRU) policy.
Therefore, when the number of users exceeds the set second threshold, the pictures corresponding to the first node combination are used for replacing the first node combination in the first message, and meanwhile, the corresponding pictures stored in the server are cleaned based on the LRU policy (Least, especially the pictures corresponding to the first node combination with the number of users not meeting the second threshold are cleaned, so that the experience of the user group corresponding to the number of users is improved, and the server resources are prevented from being too much occupied.
Specifically, please refer to [ method embodiment three ] for a picture replacement method for the detailed description of this step.
Image replacement method in method embodiment three
Fig. 5B shows a flow of a picture replacement method according to the third embodiment, which includes the following steps:
and S2310, acquiring the type information of the client 3 of the first node combination.
Wherein, in some embodiments, the client 3 category information includes one or more of a client 3 model, a client 3 operating system version, or a client 3 version.
Thus, the type of the client 3 is determined based on the detailed type information of the client 3, thereby providing a basis for accurately counting the user group of each client 3.
S2320, determining the number of users corresponding to the type of each client 3 according to the type information of the clients 3.
Thus, the number of users of the first node combination is counted according to the category information of the clients 3, and the user group of each client 3 of the first node combination is determined.
S2330, when the number of users corresponding to the type of any client 3 is greater than the second threshold, replacing the first node combination in the first message with the picture corresponding to the first node combination to generate a second message.
Therefore, when the number of users exceeds the set second threshold, the picture corresponding to the first node combination is used for replacing the first node combination in the first message, and meanwhile the corresponding picture stored in the server is cleaned based on the LRU strategy, so that the experience of a user group corresponding to the number of users is improved, and meanwhile, the server resources are prevented from being too much occupied.
In summary, in the third method embodiment, based on the second method embodiment, the number of user groups of 3 types of each client in the first node combination is counted, and when the number of user groups of 3 types of one client exceeds the set threshold, and a picture corresponding to the first node combination is used to replace the first node combination, resource consumption of the user group when the first node combination is displayed is reduced, experience of the client 3 is improved, and resource consumption of the server 1 is reduced.
The method and advantageous technical effects of the embodiments of the apparatus of the present application are described below based on fig. 6 to 9.
[ MEANS FOR EMBODIMENT I ]
Fig. 6 shows a schematic structural diagram of a first embodiment of the apparatus, which includes the following modules:
the first packet generating module 610 is configured to generate a first packet based on the request packet of the client 3, where the first packet is a tree structure including a plurality of nodes. Please refer to step S210 of [ method embodiment one ], for details of the working principle and advantageous technical effects.
The picture obtaining module 620 is configured to obtain a picture corresponding to a first node in the plurality of nodes in the first packet. Please refer to step S220 of [ method embodiment one ] for detailed working principle and advantageous technical effects.
The message replacing module 630 is configured to replace the first node in the first message with the picture corresponding to the first node, so as to generate a second message. Please refer to step S230 of [ method embodiment one ], for details of the working principle and advantageous technical effects.
The message sending module 640 is configured to send the second message to the client 3. Please refer to step S240 of [ method embodiment one ] for detailed working principle and advantageous technical effects.
[ second example of device ]
Fig. 7 shows a schematic structural diagram of a second apparatus embodiment, and in comparison with the structure of the first apparatus embodiment, the image obtaining module 622 and the message replacing module 632 are respectively used to replace the image obtaining module 620 and the message replacing module 630 in the first apparatus embodiment, and the following description focuses on the changed modules:
the image obtaining module 622 is configured to obtain an image corresponding to a first node combination in the multiple nodes of the first packet, specifically, to obtain the first node combination formed by the first node and the complexity thereof, and further specifically, to obtain the image corresponding to the first node combination when the complexity of the first node combination is greater than a first threshold. Please refer to step S222 of [ method embodiment ii ] for detailed working principle and advantageous technical effects.
Wherein the complexity of the first node combination is determined by [ a first threshold determining module ].
The message replacing module 632 is configured to replace the first node combination in the first message with the corresponding picture, so as to generate a second message. Please refer to step S232 of [ method embodiment two ] for detailed working principle and advantageous technical effects.
[ COMPLEXITY THRESHOLD DETERMINING MODULE ]
Fig. 8 shows the structure of the first threshold determining module, which includes the following modules:
the obtaining module 810 is configured to obtain a plurality of first messages. Please refer to step S410 of [ first threshold determining method embodiment ] for detailed working principle and advantageous technical effect.
A calculating module 820, configured to calculate a difference and a complexity of resource consumption of a first node combination in the multiple first messages, where the difference of the resource consumption is a difference between resource consumption occupied by displaying the first node combination based on the first message and resource consumption occupied by displaying a picture corresponding to the first node combination. Please refer to step S420 of [ first threshold determining method embodiment ] for detailed working principle and advantageous technical effect.
A determining module 830, configured to determine the first threshold based on a difference between the complexity and the resource consumption of the plurality of first node combinations. Please refer to step S430 of [ first threshold determining method embodiment ] for detailed working principle and advantageous technical effect.
[ third example of device ]
Fig. 9 shows a schematic structural diagram of a third apparatus embodiment, and in comparison with the structure of the second apparatus embodiment, a message replacement module 634 is used to replace a message replacement module 632 in the second apparatus embodiment, and the following focuses on the module:
the message replacing module 634 is configured to replace the first node combination with the corresponding picture based on the number of users of the first node combination in the first message, so as to generate a second message. The method is specifically used for acquiring the category information of the client 3 of the first node combination, and further specifically used for determining the number of users corresponding to the category of each client 3 according to the category information of the client 3, and further specifically used for replacing the first node combination in the first message with the picture corresponding to the first node combination to generate the second message when the number of users corresponding to the category of any client is greater than the second threshold. Please refer to step S234 of the third method embodiment for detailed working principle and advantageous technical effects of the message replacing module 634.
[ detailed description ] embodiments
The following describes a specific embodiment of the present application, taking a service card of a negative screen of a mobile phone as an example based on fig. 10A to 10F. The embodiments of the present application are performed in the server 1.
Fig. 10A shows a flow of a specific embodiment of a message generation method according to the present application, which includes the following steps.
S1010, generating a first message based on the message request of the client 3.
In this embodiment, the message request of the client 3 is a message request of a service card with one screen of the mobile phone.
S1020, various first node combinations are obtained from the first message, and complexity of the first node combinations is calculated, wherein the first nodes are static nodes with fixed content.
Illustratively, fig. 10B shows 3 first node combinations:
(a) The whole first message is a first node combination;
(b) A node combination is divided from the first message and comprises a node 2 and a node 3, subordinate nodes of the node 2 and the node 3 are first nodes, and the first nodes are adjacent and directly belong to the same node;
(c) 2 node combinations are separated from the message, wherein one first node combination is composed of a node 2.2 and a node 2.3, and the other node combination is a node 3.
In the present embodiment, a first node combination is selected from a trunk of the first message one by one; when nodes on one branch are all static nodes, selecting nodes of the whole branch to form a first node combination; if the first node combinations which are adjacent in sequence exist on the same level, combining the first node combinations to generate a large first node combination, and selecting the new first node combination; when the nodes on one branch are not all static nodes, the next level is entered from the branch, and the same selection is carried out on the lower subtree of the branch by the same method. The first message is optimally divided into first node combinations by adopting the top-down method.
After each first node combination is obtained, the complexity of each first node combination is determined according to the node layer number, the node complex weight and the occupied pixel area of each first node combination by using a calculation formula as shown in formula (1).
And S1030, selecting the first node combination with the complexity larger than a first threshold value from the first node combinations, and determining the joint key value of the first node combination.
The joint key value at least comprises an identifier of the first message, an identifier of the first node combination and an identifier of the client device. The identifier of the first message is used to distinguish the first message, and illustratively, the first message is generated based on the message request of the same service card, and has the same message structure, which corresponds to the service content structure of the service card, and the identifier of the first message is also referred to as a service ID; the identifier of the first node combination corresponds to the message of the first node combination in the first message, the message is also called a response message, and the identifier of the first node combination is also called a response message ID; the identification of the devices is used to distinguish between different client 3 device classes, also called device IDs.
The picture corresponding to the first node combination is determined based on the joint key value, the joint key value and the URL of the corresponding picture form a key value pair, and the key value pair is stored in the server 1. Fig. 10C shows the correspondence of the joint key value to the picture. For example, in fig. 10C, the weather service card with one negative screen of the mobile phone is taken as an example, and includes three first response messages, where the first response message corresponds to three terminal devices, three joint key values, and three pictures.
And S1040, judging whether the corresponding picture is inquired in the server 1 based on the joint key value. Wherein, when the corresponding picture is inquired, the step S1050 is executed, otherwise, the step S1070 is executed.
When the picture is inquired in the server 1, judging the number of users; otherwise, a picture corresponding to the joint key value is created and stored in the server 1.
And S1050, judging whether the number of the users of the picture is larger than a second threshold value. Wherein, if the threshold value is larger than the second threshold value, the step S1060 is executed, otherwise, the step S1080 is executed.
The number of the users is the number of the users inquiring the pictures based on the joint key value, and the users correspond to the client equipment one by one. And when the number of the users is larger than the second threshold value, replacing the corresponding response message in the first message by the URL of the picture so as to improve the user experience of the subsequent client 3.
When a large number of pictures are generated, a large number of resources of the server 1 can be occupied, in order to reduce resource usage of the server 1, the server 1 cleans expired pictures based on an LRU policy, a reasonable second threshold value is set, the server 1 timely cleans the pictures with the number of users not reaching the second threshold value, and the resources of the server 1 cannot be occupied too much while experience of a user group corresponding to the pictures is improved.
And S1060, replacing the first node combination in the first message with the picture.
Specifically, the URL of the picture is used to replace the response packet corresponding to the first node combination.
The URL of the picture displayed by the client 3 occupies less resource consumption relative to the display response message.
Exemplarily, when the response message is displayed in the mobile phone, the resource consumption is large through a detailed process of analyzing the virtual DOM structure and converting the virtual DOM interface into the display component; when the picture is displayed, the process is not operated, and the occupied resource consumption is small.
And S1070, creating a picture corresponding to the first node combination.
The created picture is stored in the server 1, and the URL of the created picture and the corresponding combined key value form a key value pair for subsequent query by other clients 3.
And S1080, adding 1 to the number of the users.
Wherein the number of users is accumulated for comparison with a second threshold.
And S1090, judging whether the unselected first node combination exists. If there are still unselected first node combinations, step S1030 is executed, otherwise step S1100 is executed.
Here, since the method of acquiring the first node combinations from above and below is implemented in step S1030, the acquired first node combinations do not intersect, and the method is an optimal segmentation strategy.
And S1100, generating a second message based on the replaced first message, and sending the second message to the client 3 for display.
Compared with the method for directly displaying the first message, the method for displaying the second message occupies smaller resource consumption, and the user experience of the client 3 is good.
Illustratively, fig. 10D shows a first message example for displaying the sports game result on the mobile phone card, which has a plurality of node contents, a complex structure, a complex display flow, and a large amount of consumed resources.
Fig. 10E shows an example of a second message, where the corresponding first message is a first node combination, and after the first node combination is replaced with the URL corresponding to the picture, the entire second message is the URL corresponding to the picture, and the message has a simple structure, a simple display flow, and a small resource consumption.
Fig. 10F shows an example of displaying the second message on the mobile phone, and by using the method according to the embodiment of the present application, the completed match result is replaced by a corresponding picture, for example, the NBA full star match result and the british sport match result enclosed by the boxes in the figure are respectively, so that the resource consumption is small, the display time is short, and the user experience of the client 3 is improved.
[ computing device embodiments ]
Fig. 11 is a schematic structural diagram of a computing device 1100 provided by an embodiment of the present application. The computing device 1100 includes: processor 1110, memory 1120, and communications interface 1130.
It is to be appreciated that the communication interface 1130 in the computing device 1100 shown in FIG. 11 can be used to communicate with other devices.
The processor 1110 may be connected to the memory 1120. The memory 1120 may be used for storing the program codes and data. Accordingly, the memory 1120 may be a memory module inside the processor 1110, an external memory module independent of the processor 1110, or a component including a memory module inside the processor 1110 and an external memory module independent of the processor 1110.
It should be understood that, in the embodiment of the present application, the processor 1110 may adopt a Central Processing Unit (CPU). The processor may also be other general purpose processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. Or the processor 1110 adopts one or more integrated circuits, and is configured to execute the relevant programs, so as to implement the technical solutions provided in the embodiments of the present application.
The memory 1120 may include a read-only memory and a random access memory, and provides instructions and data to the processor 1110. A portion of the processor 1110 may also include non-volatile random access memory. For example, processor 1110 may also store device type information.
When the computing device 1100 is run, the processor 1110 executes the computer-executable instructions in the memory 1120 to perform the operational steps of the method described above.
It should be understood that the computing device 1100 according to the embodiment of the present application may correspond to a corresponding main body for executing the method according to the embodiments of the present application, and the above and other operations and/or functions of each module in the computing device 1100 are respectively for implementing corresponding flows of each method of the embodiment, and are not described herein again for brevity.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Computer-readable storage medium embodiments
The embodiments of the present application also provide a computer-readable storage medium, on which a computer program is stored, where the computer program is used to execute at least one of the schemes described in the above embodiments when the computer program is executed by a processor.
The computer storage media of the embodiments of the present application may take any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It should be noted that the foregoing is only illustrative of the preferred embodiments of the present application and the technical principles employed. It will be understood by those skilled in the art that the present application is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the application. Therefore, although the present application has been described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present application, which all fall within the scope of the present application.

Claims (21)

1. A message generation method is characterized by comprising the following steps:
generating a first message based on a request message of a client, wherein the first message is of a tree structure comprising a plurality of nodes;
acquiring a picture corresponding to a first node in the plurality of nodes;
replacing the first node in the first message with the picture to generate a second message;
and sending the second message to the client.
2. The message generation method of claim 1, wherein,
the obtaining of the picture corresponding to the first node of the multiple nodes specifically includes:
acquiring the complexity of a first node combination formed by the first nodes;
when the complexity is larger than a first threshold value, acquiring the picture corresponding to the first node combination;
the replacing the first node in the first message with the picture to generate a second message specifically includes:
and replacing the first node combination in the first message with the picture to generate the second message.
3. The packet generation method according to claim 1 or 2, wherein the first node is a static node whose content is fixed.
4. The method for generating a packet according to claim 1, wherein the generating a second packet by replacing the first node in the first packet with the picture specifically includes:
acquiring the category information of the client;
determining the number of users corresponding to the type of the client according to the type information;
and when the number of the users is larger than a second threshold value, replacing the first node in the first message with the picture to generate a second message.
5. The message generation method of claim 4, wherein the client class information includes one or more of a client model, a client operating system version, or a client version.
6. The packet generation method according to claim 2, wherein the first threshold is determined by:
acquiring a plurality of first messages;
calculating a difference value and complexity of resource consumption of the first node combination in the plurality of first messages, wherein the difference value is a difference value between resource consumption of displaying the first node combination based on the first message and resource consumption of displaying the picture corresponding to the first node combination;
determining the first threshold based on the complexity and the difference of the plurality of first node combinations.
7. The message generation method according to claim 6, wherein the resource consumption is determined by one or more of an occupied memory and a display time for displaying the node combination.
8. The message generation method according to claim 2, further comprising:
and determining the complexity based on one or more of the node layer number, the node complexity weight and the occupied pixel area of the node combination.
9. The message generation method of claim 5, wherein the node complex weight is determined by a node type in the node combination.
10. A message generating apparatus, comprising:
the first message generation module is used for generating a first message based on a request message of a client, wherein the first message is of a tree structure comprising a plurality of nodes;
the image acquisition module is used for acquiring an image corresponding to a first node in the plurality of nodes;
a message replacing module, configured to replace the first node in the first message with the picture to generate a second message;
and the message sending module is used for sending the second message to the client.
11. The message generating apparatus according to claim 10,
the picture acquisition module is specifically used for acquiring the complexity of a first node combination formed by the first nodes; and
the image processing device is further specifically configured to obtain the image corresponding to the first node combination when the complexity is greater than a first threshold;
the message replacement module is specifically configured to replace the first node combination in the first message with the picture, so as to generate the second message.
12. The packet generation apparatus according to claim 10 or 11, wherein the first node is a static node whose content is fixed.
13. The message generating apparatus according to claim 10,
the message replacement module is specifically used for acquiring the type information of the client; and
the client is further specifically configured to determine a number of users corresponding to the category of the client according to the category information; and
and is further specifically configured to replace the first node in the first packet with the picture to generate the second packet when the number of users is greater than a second threshold.
14. The message generating device according to claim 13, wherein the category information of the client includes one or more of a client model, a client operating system version, or a client version.
15. The message generating apparatus according to claim 11, further comprising:
a first threshold generating device, configured to obtain a plurality of first messages; and
the processing module is further configured to calculate a difference and a complexity of resource consumption of the first node combination in the plurality of first messages, where the difference is a difference between resource consumption of displaying, based on a first message, the first node combination and resource consumption of displaying the picture corresponding to the first node combination; and
further configured to determine the first threshold based on the complexity and the difference for the plurality of first node combinations.
16. The message generating device according to claim 15, wherein the resource consumption is determined by one or more of an occupied memory and a display time for displaying the node combination.
17. The message generating apparatus according to claim 11, further comprising:
and determining the complexity based on one or more of the node layer number, the node complexity weight and the occupied pixel area of the node combination.
18. The packet generating apparatus according to claim 14, wherein the node complexity weight is determined by a node type in the node combination.
19. A computing device comprising a processor and a memory,
the memory stores program instructions that, when executed by the processor, cause the processor to perform the method of any of claims 1 to 9.
20. A storage medium having stored thereon program instructions which, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9.
21. A computer program product, characterized in that it comprises program instructions which, when executed by a computer, cause the computer to carry out the method of any one of claims 1 to 9.
CN202110687396.1A 2021-06-21 2021-06-21 Message generation method and device Pending CN115509675A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110687396.1A CN115509675A (en) 2021-06-21 2021-06-21 Message generation method and device
PCT/CN2022/094662 WO2022267797A1 (en) 2021-06-21 2022-05-24 Message generation method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110687396.1A CN115509675A (en) 2021-06-21 2021-06-21 Message generation method and device

Publications (1)

Publication Number Publication Date
CN115509675A true CN115509675A (en) 2022-12-23

Family

ID=84500395

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110687396.1A Pending CN115509675A (en) 2021-06-21 2021-06-21 Message generation method and device

Country Status (2)

Country Link
CN (1) CN115509675A (en)
WO (1) WO2022267797A1 (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105516261A (en) * 2015-11-26 2016-04-20 深圳市深信服电子科技有限公司 Web page loading control method and load balancer
US11272570B2 (en) * 2016-11-28 2022-03-08 Lg Electronics Inc. Method and apparatus for transmitting and receiving data in mesh network using Bluetooth
CN112104697B (en) * 2018-05-31 2022-03-04 华为技术有限公司 Data processing method, multi-cloud management system and related equipment
CN108848141A (en) * 2018-05-31 2018-11-20 郑州云海信息技术有限公司 A kind of response method of server data access and associated method and relevant apparatus

Also Published As

Publication number Publication date
WO2022267797A1 (en) 2022-12-29

Similar Documents

Publication Publication Date Title
US10447772B2 (en) Managed function execution for processing data streams in real time
US8775570B2 (en) Geographic recommendation online search system
US9396275B2 (en) Geographically partitioned online search system
US20130072233A1 (en) Geographically partitioned online content services
CN110275983A (en) The search method and device of traffic monitoring data
CN112019820B (en) Interface generation method and device
US8972278B2 (en) Recommending print locations
US20180248772A1 (en) Managing intelligent microservices in a data streaming ecosystem
CN110830604B (en) DNS scheduling method and device
JP2008211835A (en) Packet routing via payload inspection and subscription processing in publish-subscribe network
US20180270605A1 (en) System and method for providing location data over a messaging system
CN112925954A (en) Method and apparatus for querying data in a graph database
CN108154024A (en) A kind of data retrieval method, device and electronic equipment
CN113347276B (en) Mobile access system based on GIS
WO2024212767A1 (en) Video pushing method and apparatus, device, and storage medium
CN113760521B (en) Virtual resource allocation method and device
CN111310088B (en) Page rendering method and device
CN115509675A (en) Message generation method and device
CN115659033A (en) Merchant recommendation method and device and computer-readable storage medium
CN117560369A (en) Resource rendering method, device and computer readable storage medium
CN111880773A (en) Data processing method and device, electronic equipment and storage medium
CN110020111B (en) Travel recommendation method and device, computer equipment and storage medium
CN112269837A (en) Data processing method and device
CN114817780A (en) Picture loading method and device and storage medium
CN112714033B (en) Method and device for determining characteristic information of video set

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination