CN114172878B - Message processing method, device, equipment and storage medium - Google Patents

Message processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN114172878B
CN114172878B CN202111342188.4A CN202111342188A CN114172878B CN 114172878 B CN114172878 B CN 114172878B CN 202111342188 A CN202111342188 A CN 202111342188A CN 114172878 B CN114172878 B CN 114172878B
Authority
CN
China
Prior art keywords
request message
determining
preset
mode
preset mapping
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.)
Active
Application number
CN202111342188.4A
Other languages
Chinese (zh)
Other versions
CN114172878A (en
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.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology 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 Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202111342188.4A priority Critical patent/CN114172878B/en
Publication of CN114172878A publication Critical patent/CN114172878A/en
Application granted granted Critical
Publication of CN114172878B publication Critical patent/CN114172878B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The disclosure relates to a message processing method, a device, equipment and a storage medium, and relates to the technical field of message processing; the message processing device determines a mode item corresponding to the request message according to a preset mapping relation, wherein the preset mapping relation comprises a plurality of mode items, and one mode item corresponds to a plurality of types of request messages; the message processing device counts the data of the request message corresponding to the mode item in the preset time period.

Description

Message processing method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of information processing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for processing a message.
Background
A micro service is a service that divides a service provided by a single application into a plurality of small services. That is, the application server is divided into a plurality of servers. A server may provide a micro-service. The servers can coordinate and cooperate with each other to provide the needed data or information for the users.
Typically, an application server may monitor the operational status of each server based on the total number of requests received by each server and the time taken to process the requests. However, since the types and the number of the requests received by each server are relatively large, if the number of times of the requests received by each server and the time consumed for processing the requests are counted one by one, a large amount of memory of the application server is occupied.
Disclosure of Invention
The disclosure provides a message processing method, a device, equipment and a storage medium, which can solve the problem that more memory is occupied when data of a request message are counted.
The technical scheme of the embodiment of the disclosure is as follows:
according to a first aspect of embodiments of the present disclosure, there is provided a message processing method, which may include: the message processing device receives a request message from a terminal; the message processing device determines a mode item corresponding to the request message according to a preset mapping relation, wherein the preset mapping relation comprises a plurality of mode items, and one mode item corresponds to a plurality of types of request messages; the message processing device counts the data of the request message corresponding to the mode item in the preset time period.
Optionally, the message processing method may further include: the message processing device acquires a preset mapping relation, and the mode items are generated according to preset codes or in response to parameter setting operation.
Optionally, the preset mapping relationship is embodied through a table, and the message processing method may further include: the message processing apparatus writes the data of the request message into the column of the table in which the pattern item corresponding to the request message is located.
Optionally, the determining, according to the preset mapping relationship, the mode item corresponding to the request message may specifically include: analyzing the request message and determining the type of the request message; and reading a preset mapping relation, and determining a mode item corresponding to the type of the request message in the mapping relation.
Optionally, the determining the type of the request message may specifically include: analyzing the request message to obtain the identification of the request message; based on the identification, a type of the request message is determined.
Optionally, when a plurality of request messages are received, the determining, according to a preset mapping relationship, a mode item corresponding to the request message includes: and mapping the plurality of request messages to one or more mode items according to a preset mapping relation.
According to a second aspect of embodiments of the present disclosure, there is provided a message processing apparatus, the apparatus may comprise: the device comprises a receiving unit, a determining unit and a counting unit; a receiving unit for receiving a request message from a terminal; the determining unit is used for determining a mode item corresponding to the request message according to a preset mapping relation; the statistics unit is also used for counting the data of the request message corresponding to the mode item in the preset time period.
Optionally, the message processing apparatus further includes: the system comprises an acquisition unit, a parameter setting unit and a parameter setting unit, wherein the acquisition unit is used for acquiring a preset mapping relation, the preset mapping relation comprises a plurality of mode items, one mode item corresponds to a plurality of types of request messages, and the plurality of mode items are generated according to preset codes or are generated in response to parameter setting operation.
Optionally, the preset mapping relationship is embodied by a table, and the message processing device further includes: and the storage unit is used for writing the data of the request message into the column of the mode item corresponding to the request message in the table.
Optionally, the determining unit is specifically configured to parse the request message and determine a type of the request message; and reading a preset mapping relation, and determining a mode item corresponding to the type of the request message in the mapping relation.
Optionally, the determining unit is specifically configured to parse the request message to obtain an identifier of the request message; based on the identification, a type of the request message is determined.
Optionally, when the receiving unit receives a plurality of request messages, the determining unit is specifically configured to map the plurality of request messages to one or more mode items according to a preset mapping relationship.
According to a third aspect of embodiments of the present disclosure, there is provided a computing device, which may include: a processor and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement any of the above-described optional message processing methods of the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer readable storage medium having instructions stored thereon which, when executed by a processor of a computing device, enable the computing device to perform any one of the above-described optional message processing methods of the first aspect.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising computer instructions which, when run on a computing device, cause the computing device to perform a message processing method as described in any of the alternative implementations of the first aspect.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
based on any one of the above aspects, in the present disclosure, the message processing apparatus may determine a mode item corresponding to the request message according to a preset mapping relationship. When the message processing apparatus receives a plurality of request messages, the message processing apparatus may map the plurality of request messages to the limited pattern item. Then, the message processing apparatus may count data of the request message corresponding to each mode item within a preset period. Therefore, the message processing device only needs to count the data of the request message corresponding to each mode item, does not need to count the received request messages in sequence, and saves the memory.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure and do not constitute an undue limitation on the disclosure.
Fig. 1 shows a schematic structural diagram of a communication system provided in an embodiment of the present disclosure;
fig. 2 is a flow chart illustrating a message processing method according to an embodiment of the present disclosure;
FIG. 3 is a flow chart illustrating yet another message processing method provided by an embodiment of the present disclosure;
FIG. 4 is a flow chart illustrating yet another message processing method provided by an embodiment of the present disclosure;
FIG. 5 is a flow chart illustrating yet another message processing method provided by an embodiment of the present disclosure;
FIG. 6 is a flow diagram of yet another message processing method provided by an embodiment of the present disclosure;
FIG. 7 is a flow chart illustrating yet another message processing method provided by an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a message processing apparatus according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of still another message processing apparatus according to an embodiment of the present disclosure.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, and/or components.
The data referred to in this disclosure may be data authorized by the user or sufficiently authorized by the parties.
As described in the background art, in order to detect the operation states of the respective servers for providing the micro service, the application server sequentially counts the number of received request messages and the duration of processing the request messages. During the statistics period, each server for providing the micro service needs to consume a large amount of memory to count the number of received request messages and the duration of processing the messages. For servers with limited memory for providing micro-services, if there is more memory for counting the number of received messages and the duration of the messages, the normal operation of the server for providing micro-services may be affected. For example, when a server for providing a micro service receives a large number of request messages within a preset time, the server for providing a micro service needs to spend a lot of memory to count the number of received request messages and processing time while processing the request messages, which affects the efficiency of the server for providing a micro service.
In view of this, the present disclosure provides a message processing method, the method comprising: the message processing device receives a request message from a terminal; the message processing device determines a mode item corresponding to the request message according to a preset mapping relation; the message processing device counts data of the request message corresponding to the mode item.
The message processing method provided by the embodiment of the present disclosure is exemplarily described below with reference to the accompanying drawings:
fig. 1 is a schematic diagram of a communication system according to an embodiment of the disclosure, as shown in fig. 1, where the communication system may include: a server 110 and a terminal 120. The server 110 may establish a connection with the terminal 120 through a wired network or a wireless network.
The server 110 may be configured to receive a request message from the terminal 120, and perform corresponding processing according to a type of the request message. The transmission of messages between the server 110 and the terminal 120 may be based on a preset protocol. For example, the preset protocol may be an HTTP protocol, and the request message may be an HTTP request message. The HTTP request message may be used to view information, or may be used to purchase items, or may be used to obtain multimedia data, or the like. The identifiers carried in the different types of request messages are different. The identification may uniquely characterize a request message. For example, the identification of the HTTP request message may be a uniform resource locator (Uniform Resource Locator, URL).
In the present disclosure, the server 110 may include application service platforms, each of which uniquely corresponds to one application program installed on the terminal. The server 110 is mainly used for storing related service data of an application program installed on the terminal 120 and transmitting the service data to the terminal 120.
In some embodiments, the server may be a single server, or may be a server cluster formed by a plurality of servers. In some implementations, the server cluster may also be a distributed cluster. The present disclosure is also not limited to a particular implementation of server 110.
The terminal 120 may be a mobile phone, a tablet computer, a desktop, a laptop, a handheld computer, a notebook, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook, a cellular phone, a personal digital assistant (personal digital assistant, PDA), an augmented reality (augmented reality, AR), a Virtual Reality (VR) device, or the like, that may install and use a content community application (e.g., a express hand), and the specific form of the terminal is not particularly limited by the present disclosure. The system can perform man-machine interaction with a user through one or more modes of a keyboard, a touch pad, a touch screen, a remote controller, voice interaction or handwriting equipment and the like.
Alternatively, the server 110 may be connected to at least one terminal 120 in the communication system shown in fig. 1. The present disclosure is not limited in the number and type of terminals 120.
The message processing method provided by the embodiment of the present disclosure may be applied to the server shown in fig. 1.
It should be noted that, the execution body of the message processing method provided in the present disclosure is a message processing apparatus. The message processing device may be a server, or may be a chip or a system on a chip in a server, etc., without limitation.
As shown in fig. 2, the processing transmission method provided by the embodiment of the present disclosure may include:
s201, the message processing device receives a request message from the terminal.
The message processing apparatus may be the server 110 in fig. 1. The terminal may be the terminal 120 in fig. 1.
In one example, the terminal device may send a request message to the message processing apparatus in response to a user clicking on an application of the terminal. Accordingly, the message processing apparatus receives the request message from the terminal.
S202, the message processing device determines a mode item corresponding to the request message according to a preset mapping relation.
The preset mapping relationship may also be called a preset matching rule, a preset corresponding relationship, etc., which are not limited. The preset mapping relationship may be used to determine a mode item corresponding to the request message. For example, the preset mapping relationship may include a plurality of mode items and a request message corresponding to each mode item.
Wherein the pattern item is used to characterize the same attribute of multiple types of request messages. One pattern item may correspond to multiple types of request messages. For example, the mode item may be a video request type mode item, that is, the request message type corresponding to the mode item may include a plurality of request messages for requesting acquisition of video. For example, the video request class pattern item includes a request message 1, a request message 2, and a request message 3. The request message 1 is used for acquiring the video 1, the request message 2 is used for acquiring the video 2, and the request message 3 is used for acquiring the video 3.
S203, the server counts data of the request message corresponding to the mode item.
Wherein the data of the request message may be used to characterize the load situation of the server. For example, the data of the request message may include the number of request messages, the processing time length, and the like. The processing duration may refer to a duration between a time when the server receives the request message and a time when the server transmits a response message corresponding to the request message to the terminal.
Further, in the case where the number of pattern items is plural, the server may use the sum of the data of the request messages corresponding to the plural pattern items as the data of the request messages received by the server.
In one example, the server may count data of the request message corresponding to the pattern item according to a preset time period. For example, the preset time period may be 1 hour, 2 hours, etc., without limitation.
In yet another example, the server may count data of the request message corresponding to the pattern item according to a memory condition of the server. For example, when the memory usage ratio of the server is higher than the preset ratio, the data of the request message corresponding to the server statistics mode item may be triggered.
In a possible implementation, the data of the request message includes the number of request messages, and the server may be provided with a plurality of counters, one counter corresponding to each pattern item. When a request message is received, the message processing apparatus controls the counter to increase by a first value. For example, the first value may be 1. The message processing device determines the total number of the request messages under the mode item according to the count value of the counter corresponding to the mode item in the preset time.
In yet another possible implementation, the data of the request message includes a processing duration of the request message, and the message processing apparatus may have a plurality of timers, one of which may correspond to one of the mode items. When a request message is received, the message processing apparatus controls a timer corresponding to a pattern item that matches the request message to start counting. When a response message corresponding to the request message is transmitted, the message processing apparatus controls the timer corresponding to the mode item to stop counting. In this way, the message processing device can determine the processing duration of each request message in the mode item through the timer, and further can obtain the total processing duration of all the request messages in the mode item in a preset time period.
The technical scheme provided by the embodiment at least brings the following beneficial effects: as known from S201 to S203, the message processing apparatus may determine a mode item corresponding to the request message according to a preset mapping relationship. When the message processing apparatus receives a plurality of request messages, the message processing apparatus may map the plurality of request messages to the limited pattern item. Then, the message processing apparatus may count data of the request message corresponding to each mode item within a preset period. Therefore, the message processing device does not need to count the received request messages in sequence, and the memory is saved.
In one embodiment, in conjunction with fig. 2, the method may further include S301, as shown in fig. 3.
S301, the message processing device acquires a preset mapping relation.
The preset mapping relation comprises a plurality of mode items. One pattern item corresponds to a plurality of types of request messages.
The preset mapping relationship may be stored in advance by the message processing apparatus, or may be obtained by the message processing apparatus from another device, which is not limited.
In one example, the plurality of pattern items are generated according to a preset code or in response to a parameter setting operation.
For example, a request message corresponding to a pattern item may be a message processed by a server for providing a micro service. In other words, one pattern item may correspond to all request messages processed by one server for providing a micro service.
It should be noted that the generation in response to the parameter setting operation may refer to the generation in response to an operation of manually inputting a parameter. The parameters may be program code that generates pattern items. For example, a background person may input the program code through an input device, and in response to execution of the program code, the message processing device may generate a plurality of pattern items corresponding to the program code.
In yet another example, the plurality of pattern items are generated based on an interface type of the server,
the interface type of the server may refer to a type corresponding to an interface of each of the application servers for providing the micro service, which is used for receiving the request message. For example, a server for providing micro-services may be provided with one or more interfaces, each of which may be adapted to receive one or more types of request messages. The interface type may be determined in response to a code input. That is, the server may have multiple types of interfaces. In this way, the server takes the interface type as a preset matching rule.
The technical scheme provided by the embodiment at least brings the following beneficial effects: as can be seen from S301, the message processing apparatus may generate a plurality of pattern items in the preset mapping relationship according to the preset code or in response to the parameter setting operation, which is simple and convenient.
In one embodiment, in conjunction with fig. 2, as shown in fig. 4, the preset mapping relationship is embodied by a table, and the message processing method further includes S401.
S401, the message processing device writes the data of the request message into a column of the table where the mode item corresponding to the request message is located.
Wherein the table may also be used to count the data of the request messages received by each server for providing the micro-services. Wherein the server for providing the micro service may be one sub-server of the servers 110. The data of the request message received by the server for providing the micro-service may be used to characterize the load situation of the server for providing the micro-service. For example, the data of the request message may include the number of request messages received, the duration of processing the request message, and the like.
Wherein the table may include a plurality of schema entries. One pattern item may correspond to multiple types of request messages. For example, the preset table may include a mode item 1, a mode item 2, and a mode item 3. The types of the request message corresponding to the pattern item 1 may include comment type, praise type, and the like. The type of request message corresponding to mode item 2 may include capturing a first type of video, capturing a second type of video, and so forth. The types of the request message corresponding to the pattern item 3 may include purchase item 1, purchase item 2, and the like.
It should be noted that the value of the pattern item is a finite field value. That is, the number of types of request messages corresponding to one pattern item is limited. The number can be set as needed, without limitation.
In one example, the preset table may be pre-stored for the server, may be acquired from another device for the server, or may be acquired in response to an input operation. And are not limited. Each schema entry in the table may correspond to one or more columns. This column may be used to fill in the data of the request message.
For example, taking the example that the data of the request message includes the number and processing time length of the request message, the mode item of the table includes mode item 1, mode item 2, and mode item 3, the table may be as shown in table 1.
TABLE 1
It should be noted that the data in table 1 is only exemplary, and table 1 may further include other pattern items and data of the request message. And are not limited.
In one possible implementation manner, in combination with table 1, after receiving a request message, the server may fill in 1 in the column where the number of mode items corresponding to the request message is located, and write the duration of processing the request message into the corresponding column.
The technical scheme provided by the embodiment at least brings the following beneficial effects: as can be seen from S401 and S402, the server may write the request message into the column of the table where the mode item corresponding to the request is located, so as to count the data of the mode item.
In an embodiment, as shown in fig. 5 in connection with fig. 2, in S202, the method for determining, by the message processing apparatus, a mode item corresponding to the request message according to the preset mapping relationship may specifically include S501 and S502.
S501, the message processing device analyzes the request message and determines the type of the request message.
S502, the message processing device reads a preset mapping relation and determines a mode item corresponding to the type of the request message in the mapping relation.
Wherein one pattern item may correspond to a plurality of types of request messages.
The technical scheme provided by the embodiment at least brings the following beneficial effects: as can be seen from S401 and S402, the message processing apparatus may determine, according to the type of the request message, a pattern item corresponding to the type of the request message in the mapping relationship. Since one pattern item can correspond to a plurality of types of messages, that is, the message processing apparatus can write a pattern item with a plurality of request messages, the data of the pattern item can be counted later.
In one embodiment, as shown in fig. 6 in conjunction with fig. 5, in S501, the method for determining the type of the request message by the message processing apparatus analyzing the request message may specifically include S601 and S602.
S601, the message processing device analyzes the request message to obtain the identification of the request message.
Wherein the identification of the request message may be used to characterize the type of request message.
In one example, taking the identification of the request message as an HTTP request message as an example, the identification of the request message may be a URL.
S602, the message processing device determines the type of the request message according to the identification of the request message.
In one example, the URL in the request message includes a character that may be used to represent a class of multimedia data. For example, the character is "car", i.e., the request message may be used to obtain video data associated with the vehicle. For another example, the character may be a user ID. The server, upon receiving the request message carrying the identifier, may determine the mode item corresponding to the identifier. For example, the server may write the data of the request message under a pattern item associated with the vehicle. For another example, the server may write the data of the request message under a pattern item associated with a certain class of users.
The technical scheme provided by the embodiment at least brings the following beneficial effects: as can be seen from S601 and S602, the message processing apparatus may determine a mode item corresponding to the request message according to the identifier in the request message. Since the identification of the request message may be used to characterize the type of the request message, the message handling device may accurately determine the type of the request message and the corresponding pattern item.
In an embodiment, as shown in fig. 7 in conjunction with fig. 6, when the message processing apparatus receives a plurality of request messages, in S202, the method for determining, by the message processing apparatus, a mode item corresponding to the request message according to a preset mapping relationship may specifically be S701.
S701, the message processing device maps a plurality of request messages to one or a plurality of mode items according to a preset mapping relation.
The description of the predetermined mapping relationship may be referred to as 202 above, which is not repeated.
The types of the plurality of request messages may be the same, different, or partially the same. When the types of the plurality of request messages are the same, the message processing device can map the plurality of request messages to a mode item corresponding to the type according to a preset mapping relation; when the types of the plurality of request messages are different, the message processing device can map the request messages with the same type to the same mode item according to a preset mapping relation; when the types of the plurality of request messages are different, the message processing device can map the plurality of request messages to corresponding mode items according to a preset mapping relation.
The technical scheme provided by the embodiment at least brings the following beneficial effects: as can be seen from S701, when the message processing apparatus receives a plurality of request messages, the plurality of message processing apparatuses may be mapped to a smaller number of mode items according to a preset mapping relationship, that is, the open value range is mapped to the finite field, so that the number statistics of subsequent request messages may be facilitated.
It will be appreciated that, in actual implementation, the message processing apparatus according to the embodiments of the present disclosure may include one or more hardware structures and/or software modules configured to implement the foregoing corresponding message processing method, where the executing hardware structures and/or software modules may constitute an electronic device. Those of skill in the art will readily appreciate that the algorithm steps of the examples described in connection with the embodiments disclosed herein may be implemented as hardware or a combination of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the 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 disclosure.
Based on such understanding, the embodiment of the disclosure also correspondingly provides a message processing device. Fig. 8 shows a schematic structural diagram of a message processing apparatus provided by an embodiment of the present disclosure. As shown in fig. 8, the message processing apparatus may include: a receiving unit 801, a determining unit 802, and a counting unit 803.
A receiving unit 801 for receiving a request message from a terminal; a determining unit 802, configured to determine a mode item corresponding to the request message according to a preset mapping relationship; a statistics unit 801, configured to count data of a request message corresponding to an mode item in a preset period. For example, in connection with fig. 2, the statistics unit 801 is used to perform S203.
Optionally, as shown in fig. 8, the message processing apparatus further includes an acquisition unit 804. The obtaining unit 804 is configured to obtain a preset mapping relationship, where the preset mapping relationship includes a plurality of mode items, one mode item corresponds to a plurality of types of request messages, and the plurality of mode items are generated according to a preset code or are generated in response to a parameter setting operation on a parameter.
Optionally, the preset mapping relationship is embodied through a table. As shown in fig. 8, the message processing apparatus may further include a storage unit 805. And a storage unit 805 configured to write data of the request message into a column in the table where the mode item corresponding to the request message is located.
Optionally, the determining unit 802 is specifically configured to: analyzing the request message and determining the type of the request message; and reading a preset mapping relation, and determining a mode item corresponding to the type of the request message in the mapping relation.
Optionally, the determining unit 802 is specifically configured to: analyzing the request message to obtain the identification of the request message; the type of the request message is determined based on the identification.
Alternatively, when the receiving unit 801 receives a plurality of request messages, the determining unit 802 is specifically configured to: and mapping the plurality of request messages to one or more mode items according to a preset mapping relation.
As described above, the embodiments of the present disclosure may divide functional modules of a message processing apparatus according to the above-described method examples. The integrated modules may be implemented in hardware or in software functional modules. In addition, it should be further noted that the division of the modules in the embodiments of the present disclosure is merely a logic function division, and other division manners may be implemented in practice. For example, each functional module may be divided corresponding to each function, or two or more functions may be integrated in one processing module.
The detailed description of the specific manner in which each module performs the operation and the beneficial effects of the message processing apparatus in the foregoing embodiment is already described in the foregoing method embodiment, and will not be repeated here.
The embodiment of the disclosure also provides a message processing device. Fig. 9 shows a schematic structural diagram of a message processing apparatus provided by an embodiment of the present disclosure. The message processing apparatus may comprise at least one processor 91, a communication bus 92, a memory 93 and at least one communication interface 94.
The processor 91 may be a processor (central processing units, CPU), microprocessor unit, ASIC, or one or more integrated circuits for controlling the execution of the programs of the present disclosure. As an example, in connection with fig. 8, the determining unit 802 in the message processing apparatus realizes the same functions as the processor 91 in fig. 9.
Communication bus 92 may include a path to transfer information between the above components.
The communication interface 94 uses any transceiver-like means for communicating with other devices or communication networks, such as servers, ethernet, radio access network (radio access network, RAN), wireless local area network (wireless local area networks, WLAN), etc. As an example, in connection with fig. 8, the acquisition unit 804 in the message processing apparatus realizes the same function as the communication interface 94 in fig. 9.
The memory 93 may be, but is not limited to, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (random access memory, RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM), a compact disc read-only memory (compact disc read-only memory) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory may be stand alone and be connected to the processing unit by a bus. The memory may also be integrated with the processing unit.
Wherein the memory 93 is used to store application code for performing aspects of the present disclosure and is controlled by the processor 91 for execution. The processor 91 is operative to execute application code stored in the memory 93 to thereby implement the functions in the methods of the present disclosure.
In a particular implementation, processor 91 may include one or more CPUs, such as CPU0 and CPU1 of FIG. 9, as an embodiment.
In a specific implementation, as an embodiment, the terminal may include multiple processors, such as processor 91 and processor 95 in fig. 9. Each of these processors may be a single-core (single-CPU) processor or may be a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
In a specific implementation, as an embodiment, the message processing apparatus may further include an input device 96 and an output device 97. The input device 96 and the output device 97 communicate and may accept user input in a variety of ways. For example, the input device 96 may be a mouse, keyboard, touch screen device, or sensing device, among others. The output device 97 communicates with the processor 91 and may display information in a variety of ways. For example, the output device 97 may be a liquid crystal display (liquid crystal display, LCD), a light emitting diode (light emitting diode, LED) display device, or the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 9 is not limiting of the message processing apparatus and may include more or fewer components than shown, or may combine certain components, or may employ a different arrangement of components.
The present disclosure also provides a computer-readable storage medium comprising instructions stored thereon, which when executed by a processor of a computer device, enable the computer to perform the message processing method provided by the above-described illustrated embodiments. For example, the computer readable storage medium may be a memory 93 comprising instructions executable by the processor 91 of the message processing apparatus to perform the above-described method. For another example, the computer readable storage medium may be a memory 93 including instructions executable by the processor 91 of the server to perform the above-described method. Alternatively, the computer readable storage medium may be a non-transitory computer readable storage medium, for example, a ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
The present disclosure also provides a computer program product comprising computer instructions which, when run on a message processing apparatus, cause the message processing apparatus to perform the message processing method shown in any of the above figures 2 to 7.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (14)

1. A message processing method, applied to a server, the method comprising:
receiving a request message from a terminal;
determining a mode item corresponding to the request message according to a preset mapping relation, wherein the preset mapping relation comprises a plurality of mode items, and one mode item corresponds to a plurality of types of request messages;
and when the memory use proportion of the server is higher than a preset proportion, counting the data of the request message corresponding to the mode item in a preset time period.
2. The method according to claim 1, wherein before the determining the mode item corresponding to the request message according to the preset mapping relationship, the method further includes:
and acquiring the preset mapping relation, wherein the plurality of mode items are generated according to preset codes or are generated in response to parameter setting operation.
3. The method of claim 1, wherein the preset mapping relationship is embodied by a table, the method further comprising:
and writing the data of the request message into a column of the table, in which the mode item corresponding to the request message is located.
4. A method according to any one of claims 1-3, wherein determining a mode item corresponding to the request message according to a preset mapping relationship includes:
analyzing the request message and determining the type of the request message;
and reading the preset mapping relation, and determining a mode item corresponding to the type of the request message in the mapping relation.
5. The method of claim 4, wherein the determining the type of the request message comprises:
analyzing the request message to obtain the identification of the request message;
and determining the type of the request message according to the identification.
6. The method according to claim 5, wherein when a plurality of request messages are received, the determining, according to a preset mapping relationship, a mode item corresponding to the request message includes:
and mapping the plurality of request messages to one or more mode items according to the preset mapping relation.
7. A message processing apparatus, characterized by being applied to a server, the apparatus comprising a receiving unit, a determining unit and a statistics unit;
the receiving unit is used for receiving the request message from the terminal;
the determining unit is configured to determine a mode item corresponding to the request message according to a preset mapping relationship, where the preset mapping relationship includes a plurality of mode items, and one mode item corresponds to a plurality of types of request messages;
and the statistics unit is used for counting the data of the request message corresponding to the mode item in a preset time period when the memory use proportion of the server is higher than the preset proportion.
8. The apparatus of claim 7, wherein the apparatus further comprises an acquisition unit;
the obtaining unit is configured to obtain the preset mapping relationship before determining a mode item corresponding to the request message according to the preset mapping relationship, where the mode items are generated according to a preset code or generated in response to a parameter setting operation.
9. The apparatus of claim 7, wherein the preset mapping relationship is embodied by a table, the apparatus further comprising a storage unit;
and the storage unit is used for writing the data of the request message into a column of the table, in which the mode item corresponding to the request message is located.
10. The apparatus according to any one of claims 7-9, wherein the determining unit is specifically configured to:
analyzing the request message and determining the type of the request message;
and reading the preset mapping relation, and determining a mode item corresponding to the type of the request message in the mapping relation.
11. The apparatus according to claim 10, wherein the determining unit is specifically configured to:
analyzing the request message to obtain the identification of the request message;
and determining the type of the request message according to the identification.
12. The apparatus according to claim 11, wherein the determining unit is specifically configured to, when a plurality of request messages are received:
and mapping the plurality of request messages to one or more mode items according to the preset mapping relation.
13. A computing device, the computing device comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the message processing method of any of claims 1-6.
14. A computer readable storage medium having instructions stored thereon, which when executed by a processor of a computing device, cause the computing device to perform the message processing method of any of claims 1-6.
CN202111342188.4A 2021-11-12 2021-11-12 Message processing method, device, equipment and storage medium Active CN114172878B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111342188.4A CN114172878B (en) 2021-11-12 2021-11-12 Message processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111342188.4A CN114172878B (en) 2021-11-12 2021-11-12 Message processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114172878A CN114172878A (en) 2022-03-11
CN114172878B true CN114172878B (en) 2023-12-26

Family

ID=80479221

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111342188.4A Active CN114172878B (en) 2021-11-12 2021-11-12 Message processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114172878B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110266555A (en) * 2019-05-09 2019-09-20 重庆八戒电子商务有限公司 Method for analyzing web site service request
CN113014475A (en) * 2021-03-12 2021-06-22 中国平安财产保险股份有限公司 Message pushing integration method and device
CN113127232A (en) * 2021-04-19 2021-07-16 北京京东振世信息技术有限公司 Message processing method, device, equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110266555A (en) * 2019-05-09 2019-09-20 重庆八戒电子商务有限公司 Method for analyzing web site service request
CN113014475A (en) * 2021-03-12 2021-06-22 中国平安财产保险股份有限公司 Message pushing integration method and device
CN113127232A (en) * 2021-04-19 2021-07-16 北京京东振世信息技术有限公司 Message processing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN114172878A (en) 2022-03-11

Similar Documents

Publication Publication Date Title
CN109218133B (en) Network speed testing system, method, device and computer readable storage medium
CN107798108B (en) Asynchronous task query method and device
US10171604B2 (en) System and method for pushing network information
CN110336888B (en) Server distribution method, device, system and medium
CN111339047B (en) Data interaction method, device and system
CN110928594A (en) Service development method and platform
CN114172878B (en) Message processing method, device, equipment and storage medium
CN111090666A (en) Data processing method, device and system and computer readable storage medium
CN111339560A (en) Data isolation method, device and system
CN111427887A (en) Method, device and system for rapidly scanning HBase partition table
CN113377423A (en) Method and device for providing service and electronic equipment
CN114302207A (en) Bullet screen display method, device, system, equipment and storage medium
CN113992989A (en) Content display method, device, system, equipment and storage medium
CN115022397A (en) Interface parameter simplifying method and device, electronic equipment and storage medium
CN114676272A (en) Information processing method, device and equipment of multimedia resource and storage medium
KR20050009138A (en) Information transmitting apparatus and method, information receiving apparatus and method, information providing system
CN113094131A (en) Prompt resource display method, device, terminal, server and storage medium
CN111124907A (en) Mobile phone game testing method and device and server
CN112637254A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN109561146A (en) Document down loading method, device, terminal device
CN113747185B (en) Information interaction method, device, system, equipment and storage medium
CN115391042B (en) Resource allocation method and device, electronic equipment and storage medium
CN114443196B (en) User interface processing method and system and electronic equipment
CN113111047B (en) Data processing method and device and electronic equipment
CN116861455B (en) Event data processing method, system, electronic device and storage medium

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
GR01 Patent grant
GR01 Patent grant