CN110597647B - Message interception method and device, electronic equipment and storage medium - Google Patents

Message interception method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110597647B
CN110597647B CN201910872646.1A CN201910872646A CN110597647B CN 110597647 B CN110597647 B CN 110597647B CN 201910872646 A CN201910872646 A CN 201910872646A CN 110597647 B CN110597647 B CN 110597647B
Authority
CN
China
Prior art keywords
page
message
code
interface
target
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
CN201910872646.1A
Other languages
Chinese (zh)
Other versions
CN110597647A (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.)
Wuba Co Ltd
Original Assignee
Wuba 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 Wuba Co Ltd filed Critical Wuba Co Ltd
Priority to CN201910872646.1A priority Critical patent/CN110597647B/en
Publication of CN110597647A publication Critical patent/CN110597647A/en
Application granted granted Critical
Publication of CN110597647B publication Critical patent/CN110597647B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention provides a message interception method, a message interception device, electronic equipment and a storage medium, wherein the method comprises the following steps: naming a message interface corresponding to each level page in a response chain to obtain a self-defined name of the message interface; determining a target page; determining a target message interface by combining the target page and the custom name of each message interface; replacing an interface code corresponding to the target message interface with an interception code; and intercepting the currently transmitted message by utilizing the interception code. Therefore, the message transmission method provided by the application can accurately intercept the required message in the page of the specified level, and meanwhile, the normal transmission of the message is not influenced.

Description

Message interception method and device, electronic equipment and storage medium
Technical Field
The application relates to the technical field of App development, in particular to a message interception method, a message interception device, electronic equipment and a storage medium.
Background
The development of apps (Application software) relies on an internal message passing mechanism, and generally, apps include multiple levels of pages, each level of pages responding to a different message, and messages are passed between pages of each level. During the development process, a developer often needs to intercept messages on a page of a certain target level, and the operation of intercepting the messages needs to rely on a message delivery mechanism.
Common message passing mechanisms fall into three categories, broker, block callback and notification. Specifically, when messages are transferred in a proxy or block callback mode, the messages respond sequentially from the lowest-level page to the highest-level page, wherein the higher-level page refers to part of the code of the lower-level page to complete the response. When the message is transmitted in a notification manner, the message and the response result of the message on each page are transmitted to all pages in a broadcast manner, so that each page holds all the messages and the response results thereof on each page.
Through the working principle of each message passing mechanism, when a proxy or a block callback mode is adopted to pass messages, serious code coupling exists between a page of a higher level and a page of a lower level, and if a message is required to be intercepted on a page of a certain level, codes need to be sequentially referred to from a page of the lowest level to the page of the level. However, the intercepted message is easily affected by code coupling between pages of various levels, and the accuracy is low. Although the problem of code coupling among pages of each hierarchy can be solved by adopting a notification mode to transmit messages, the problem of low accuracy of intercepted messages can also be caused by excessive broadcast messages received by each hierarchy.
Disclosure of Invention
The application provides a message interception method, a message interception device, electronic equipment and a storage medium, which are used for solving the problem of low accuracy of information intercepted by a page of a certain level by using the existing message transmission mechanism.
In a first aspect, an embodiment of the present invention provides a message interception method, where the method includes:
naming a message interface corresponding to each level page in a response chain to obtain a self-defined name of the message interface;
determining a target page, wherein the target page is a preset page in which a message intercepting action is generated;
determining a target message interface by combining the target page and the custom name of each message interface;
replacing an interface code corresponding to the target message interface with an interception code, wherein the interception code is used for intercepting a currently transmitted message and transmitting the message to a next-level page of the target page;
and intercepting the currently transmitted message by utilizing the interception code.
In a possible implementation manner of the first aspect of the embodiment of the present invention, obtaining the self-defined name of the message interface, where the message interface corresponds to each level page in the named response chain, includes:
acquiring a message interface corresponding to the page;
pre-naming the message interface to obtain a standby name of the message interface, wherein the standby name at least comprises a name of the hierarchy information of the corresponding page;
replacing duplicate names, which are the same standby names used by more than one message interface, with available names, which are different names from each of the standby names, resulting in custom names for each message interface.
In a possible implementation manner of the first aspect of the embodiment of the present invention, the determining a target page includes:
acquiring page level information in a preset interception instruction;
determining a preselected page according to the page level information, wherein the preselected page is all pages corresponding to the page level information;
and determining a target page from all the preselected pages, wherein the target page is the preselected page where the contact points are located, and the contact points are stress points of the page for receiving touch.
In a possible implementation manner of the first aspect of the embodiment of the present invention, the determining a target message interface in combination with the target page and the custom name of each message interface includes:
acquiring the page level of the target page;
matching the page level of the target page with the custom name of each message interface;
and determining a target message interface, wherein the target message interface is a message interface of which the hierarchical information in the custom name is matched with the page level of the target page.
In a possible implementation manner of the first aspect of the embodiment of the present invention, the replacing the interface code corresponding to the target message interface as an interception code includes:
determining a code to be replaced, wherein the code to be replaced is a code of an interface code, which contains a message name and parameter information to be transmitted in a message;
inserting the interception code into an insertion node of the interface code, wherein the insertion node is a node adjacent to a first character or a last character in the code to be replaced in the interface code;
and deleting the code to be replaced.
In a second aspect, an embodiment of the present invention provides a message interception apparatus, where the apparatus includes:
the naming module is used for naming the message interfaces corresponding to the pages of each level in the response chain to obtain the self-defined names of the message interfaces;
the target page determining module is used for determining a target page, wherein the target page is a preset page in which a message capturing action is generated;
the target message interface determining module is used for determining a target message interface by combining the target page and the custom name of each message interface;
the replacing module is used for replacing an interface code corresponding to the target message interface with an interception code, wherein the interception code is used for intercepting a currently transmitted message and transmitting the message to a next-level page of the target page;
and the interception module is used for intercepting the currently transmitted message by utilizing the interception code.
In a possible implementation manner of the second aspect of the embodiment of the present invention, the naming module includes:
the interface acquisition module is used for acquiring a message interface corresponding to the page;
the pre-naming module is used for pre-naming the message interface to obtain a standby name of the message interface, wherein the standby name at least comprises the name of the hierarchy information of the corresponding page;
and the duplication removing module is used for replacing the duplicate names which are the same standby names used by more than one message interface with the available names different from the standby names to obtain the self-defined names of the message interfaces.
In a possible implementation manner of the second aspect of the embodiment of the present invention, the target page determining module includes:
the page level information acquisition module is used for acquiring page level information in a preset interception instruction;
a preselected page determining module, configured to determine a preselected page according to the page level information, where the preselected page is all pages corresponding to the page level information;
and the target page determining module is used for determining a target page from all the preselected pages, wherein the target page is the preselected page where the contact points are located, and the contact points are stress points of the page for receiving touch.
In a possible implementation manner of the second aspect of the embodiment of the present invention, the target message interface determining module includes:
the page level acquisition module is used for acquiring the page level of the target page;
the matching module is used for matching the page level of the target page with the custom name of each message interface;
and the interface determining module is used for determining a target message interface, wherein the target message interface is a message interface of which the hierarchy information in the custom name is matched with the page level of the target page.
In a possible implementation manner of the second aspect of the embodiment of the present invention, the replacing module includes:
the code determination module is used for determining a code to be replaced, wherein the code to be replaced is a code of an interface code, which contains a message name and parameter information to be transmitted in a message;
a code insertion module, configured to insert the interception code into an insertion node of the interface code, where the insertion node is a node in the interface code that is adjacent to a first character or a last character in the code to be replaced;
and the code deleting module is used for deleting the code to be replaced.
In a third aspect, an embodiment of the present invention provides an electronic device, where the electronic device includes:
a processor, and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the messaging method of any of claims 1-5 via execution of the executable instructions.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements a message delivery method.
In the message interception method, message interfaces corresponding to each level page in a response chain are named first, and each message interface is distinguished by a user-defined name. And then determines the target page that needs to intercept the message. And determining the target message interface corresponding to the target page by combining the target page and the custom name of each message interface. And replacing the interface code corresponding to the target message interface with an interception code, wherein at the moment, the target page not only can be used for intercepting the currently transmitted message, but also can normally transmit the message to the next-level page. At this time, the interception code is utilized to intercept the currently transmitted message on the target page. Therefore, the message transmission method provided by the application can accurately intercept the required message in the page of the specified level, and meanwhile, the normal transmission of the message is not influenced.
Drawings
In order to more clearly explain the technical solution of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious to those skilled in the art that other drawings can be obtained according to the drawings without any creative effort.
FIG. 1 illustrates a flow chart of the delivery of Touch events;
FIG. 2 shows a flow chart of a message interception method;
FIG. 3 shows a schematic distribution of the various levels;
FIG. 4 illustrates a flow chart of a method of naming a message interface;
FIG. 5 illustrates a flow chart of a method of determining a destination page;
FIG. 6 illustrates a flow chart of a method of determining a target message interface;
FIG. 7 illustrates a flow chart of a method of inserting an interception code;
fig. 8 is a schematic structural diagram of a first embodiment of a message interception apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a second embodiment of a message interception apparatus according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a third embodiment of a message interception apparatus according to the present application;
fig. 11 is a schematic structural diagram of a fourth embodiment of a message interception apparatus according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a fifth embodiment of a message interception apparatus according to an embodiment of the present application;
fig. 13 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The development of apps (Application software) relies on an internal message passing mechanism, and generally, apps include multiple levels of pages, each level of pages responding to a different message, and messages are passed between pages of each level. During the development process, a developer often needs to intercept messages on a page of a certain target level, and the operation of intercepting the messages needs to rely on a message delivery mechanism.
Common message passing mechanisms fall into three categories, broker, block callback and notification. Specifically, when messages are transferred in a proxy or block callback mode, the messages respond sequentially from the lowest-level page to the highest-level page, wherein the higher-level page refers to part of the code of the lower-level page to complete the response. When the message is transmitted in a notification manner, the message and the response result of the message on each page are transmitted to all pages in a broadcast manner, so that each page holds all the messages and the response results thereof on each page.
Through the working principle of each message passing mechanism, when a proxy or a block callback mode is adopted to pass messages, serious code coupling exists between a page of a higher level and a page of a lower level, and if a message is required to be intercepted on a page of a certain level, codes need to be sequentially referred to from a page of the lowest level to the page of the level. However, the intercepted message is easily affected by code coupling between pages of various levels, and the accuracy is low. Although the problem of code coupling among pages of each hierarchy can be solved by adopting a notification mode to transmit messages, the problem of low accuracy of intercepted messages can also be caused by excessive broadcast messages received by each hierarchy.
Therefore, the function of intercepting the message in the page with the specified level in the message transmission process cannot be realized by adopting the existing message transmission mechanism, and meanwhile, the accuracy of the intercepted message is lower.
In order to solve the above problem, embodiments of the present application provide a message interception method, an apparatus, an electronic device, and a storage medium, where the message interception method is based on a message delivery mechanism of a response chain.
Messages are manipulated from the outside, e.g. by clicking on a touch screen, pressing a physical button, etc., and entered in the form of an event into a response chain, which typically handles the event via the uiresponse class, which defines an object interface for responding to and handling the event, whose subclasses include the UIApplication class, the UIView controller class, the UIView class, and subclasses of the UIView class, etc., whose instance objects are called response objects or responders. Specifically, corresponding to pages of various levels, pages of different levels correspond to uiresponse classes or subclasses of uiresponse classes, and events are responded to and processed through the classes. Meanwhile, the instance object of the UIResponder class has an important attribute, namely nextResponder, and the next responder can acquire the next responder on the response chain through the attribute, so that the response and the transmission of the event among the pages of each hierarchy are completed.
For example, for the delivery of Touch events.
FIG. 1 shows a flow chart of the delivery of Touch events.
When a user needs to issue an instruction, it is usually implemented by clicking a corresponding area on the terminal screen, and at this time, the message of the instruction enters the response chain in the form of an event. The response chain is composed of SubView1, SubView 2, UIView3, UIView controller4, UIWindow5 and UIapplication6 in sequence. First, the subView1 attempts to process the event and if it cannot be responded to, passes to the next responder superView 2. If the superView2 fails to respond to the event, it is passed to the next responder UIView 3. If UIView3 fails to respond to the event, it is passed to the next responder UIViewController 4. If UIViewController4 fails to respond to the event, it passes to the next responder, UIWindow 5. If UIWindow5 fails to respond to the event, it is passed to UIapplication 6. If the UIapplication6 still fails to respond to the event, the event is discarded, indicating that the event is invalid and requiring the user to reissue the instruction. If the event is responded in any hierarchy, the event is effective, and relevant response results can be returned to the user.
Based on the message transmission mechanism of the response chain, the embodiment of the application provides a message interception method.
Please refer to fig. 2, which is a flowchart illustrating a message interception method according to an embodiment of the present application. The method can be applied to operable terminals such as servers, PCs (personal computers), tablet computers and mobile phones.
As shown in fig. 2, the method includes:
and S1, naming the message interfaces corresponding to the pages of each level in the response chain to obtain the self-defined names of the message interfaces.
As can be seen from the above, each hierarchical page corresponds to each class, and each class defines an object interface for responding to and processing events, where the object interface is a message interface corresponding to each hierarchical page. As can be seen, although the messages transmitted by each level page are the same, the message interfaces need to be distinguished because the level where the message interface is located and the page corresponding to the level are different, so that the message on the required page can be accurately acquired through the message interfaces.
For example, fig. 3 shows a distribution diagram of the various levels. As shown in FIG. 3, View A is the entire View of the terminal display screen, View B and View C are pages of the same level, and View F, View D and View E are pages of the same level. Therefore, a plurality of pages at the same level can exist at the same time, and the pages at the same level can also belong to different upper-level pages. Therefore, if the message interfaces corresponding to the pages are not named explicitly, the messages of the corresponding pages cannot be intercepted accurately through the message interfaces. The naming method provided by the embodiment of the application can effectively distinguish each message interface. For example, the named message interfaces are UIResponder + MessageSend a, and UIResponder + MessageSend b.
Specifically, fig. 4 shows a flow chart of a method of naming a message interface, the method comprising:
s101, acquiring a message interface corresponding to the page;
s102, the message interface is pre-named to obtain a standby name of the message interface, wherein the standby name at least comprises the name of the hierarchy information of the corresponding page;
s103, replacing the available names of the repeated names to obtain the self-defined names of all the message interfaces, wherein the repeated names are the same standby names used by more than one message interfaces, and the available names are different from all the standby names.
Acquiring message interfaces corresponding to the pages of each hierarchy, for example, the page in the superView A comprises a subView a, a subView b and a subView c, and the corresponding message interfaces are a, b and c respectively; the page in the superView B comprises a subView a, a subView B and a subView c, and the corresponding message interfaces are a, B and c respectively. Presetting names of all message interfaces to obtain the names of all message interfaces in superView A to be used, namely UIResponder + MessageSend a, UIResponder + MessageSend b, and UIResponder + MessageSend c; the standby names of the message interfaces in superView B are UIResponder + MessageSend a, UIResponder + MessageSend B, and UIResponder + MessageSend c. As can be seen, the standby names of the message interfaces in the superView A and the superView B are repeatedly used.
In order to accurately intercept and capture the message through each message interface, each message interface needs to be accurately distinguished, and therefore, the standby names of each message interface need to be subjected to deduplication processing. For example, the duplicate names UIResponder + MessageSend a, UIResponder + MessageSend b, UIResponder + MessageSend c in superView A, and UIResponder + MessageSend a, UIResponder + MessageSend b, UIResponder + MessageSend c in superView B. In order to avoid duplication, the duplicate names described above need to be replaced with available names that do not duplicate each other. The duplicate name in superView a or superView B may be replaced with an available name, for example, after the replacement, the standby names of each message interface in superView a are UIResponder + MessageSend, UIResponder + MessageSend f, UIResponder + MessageSend g; the standby names of the message interfaces in superView B are UIResponder + MessageSend a, UIResponder + MessageSend B, and UIResponder + MessageSend c. Or the standby names of the message interfaces in the superView A are UIResponder + MessageSend a, UIResponder + MessageSend b, UIResponder + MessageSend c; the standby names of the message interfaces in the superView B are UIResponder + MessageSend e, UIResponder + MessageSend f, UIResponder + MessageSend g, or the repeated names in the superView A and the superView B can be integrally replaced by available names, for example, after the replacement, the standby names of the message interfaces in the superView A are UIResponder + MessageSend e, UIResponder + MessageSend f, UIResponder + MessageSend g; the standby names of the message interfaces in superView B are UIResponder + MessageSend h, UIResponder + MessageSend i, and UIResponder + MessageSend j.
The names after replacement are different from each other, and each message interface has unique identification, so that the message interfaces can accurately correspond to each message interface through the names of the message interfaces, and the message can be accurately intercepted from a page of a certain specified level through the message interfaces.
And S2, determining a target page, wherein the target page is a preset page where the message capturing action is generated.
Through the steps, each message interface on the page is named, and at the moment, a target page needing to intercept the message needs to be determined according to the requirements of the user.
Specifically, fig. 5 shows a flowchart of a method for determining a target page, where the method includes:
s201, acquiring page level information in a preset interception instruction;
s202, determining a preselected page according to the page level information, wherein the preselected page is all pages corresponding to the page level information;
s203, determining a target page from all the preselected pages, wherein the target page is the preselected page where the contact is located, and the contact is a stress point where the page is touched.
The user can preset an interception instruction before the message is transmitted, at the moment, the preset interception instruction is a fixed instruction, namely page level information in the preset interception instruction is fixed and invariable, and no matter any message is intercepted, interception can be carried out on a level designated in the preset interception instruction. Certainly, the user may send the preset interception instruction in real time during the message transmission process, at this time, the preset interception instruction is a dynamic instruction, that is, page level information in the preset interception instruction sent each time may be different, and the message may be intercepted from a page corresponding to a different level each time.
The page level information at least needs level information of the interception action, for example, initiating the interception action on subView, superView, UIView controller, UIWindow, or UIApplication.
As shown in fig. 3, each level includes several different pages, so that according to the page level information, all pages corresponding to the level can be determined, and these pages are defined as pre-selected pages, and the pre-selected pages all have an opportunity to participate in message transmission. However, when a message is sent out, for example, a Touch command is sent out, that is, the user touches the display screen, not all pages can sense the Touch point, but only the page sensing the Touch point is the page actually participating in message transmission. For example, View B and View C are pages of the same level, where a touch point can be sensed on View B, but View B is a target page if View C cannot sense the touch point, and therefore, a message can be effectively intercepted only by an intercepting action performed on View B, and if the intercepting action is performed on View C, only a result that the message is empty can be obtained.
And S3, determining the target message interface by combining the target page and the custom name of each message interface.
As can be seen from the above, the area where the response, processing, and transmission of the message are really realized on each page is the message interface, and therefore, after the target page is determined, the message interface corresponding to the target page needs to be accurately determined, and the message can be intercepted from the message interface.
Specifically, fig. 6 shows a flowchart of a method of determining a target message interface, the method comprising:
s301, acquiring the page level and the page information of the target page;
s302, matching the page level of the target page with the custom name of each message interface;
s303, determining a target message interface, wherein the target message interface is a message interface of which the hierarchy information and the page information in the custom name are matched with the page level and the page information of the target page.
Generally, the custom name of each message interface includes level information of the message interface, for example, the custom name is UIView + MessageSend a, where UIView is a level where the message interface is located, and according to the name rule of the message interface, the MessageSend a in the custom name can clearly represent a certain page in the UIView level. Therefore, once the page level and the page information of the target page can be matched with the level information and the page information of a certain message interface, the message interface is the target message interface corresponding to the target page.
Or after naming each message interface, storing the self-defined name of each message interface and the corresponding relation between the respective defined name and the page. Thus, once the target page is determined, the user-defined name can be directly determined according to the corresponding relation between the stored user-defined name and the page, and then the target message interface is determined.
And S4, replacing the interface code corresponding to the target message interface with an interception code, wherein the interception code is used for intercepting the currently transmitted message and transmitting the message to the next-level page of the target page.
After the target message interface is determined, an interception code needs to be inserted in the target message interface for intercepting the currently delivered message. In particular, fig. 7 shows a flow chart of a method of inserting an interception code, the method comprising:
s401, determining a code to be replaced, wherein the code to be replaced is a code of an interface code, and the code comprises a message name and parameter information to be transmitted in a message;
s402, inserting the interception code into an insertion node of the interface code, wherein the insertion node is a node adjacent to a first character or a last character in the code to be replaced in the interface code;
and S403, deleting the code to be replaced.
The actions of responding, processing and transmitting messages in the message interface all depend on interface codes, so that the message can be intercepted only by replacing the interface codes related to the transmitted messages. In order not to affect other functions of the target message interface, the code to be replaced needs to be accurately determined. And inserting an interception code in front of or behind the code to be replaced, wherein the code to be replaced is A x B, wherein A is a first character in the code to be replaced, B is a last character in the code to be replaced, and the inserted node can be before A or after B. If the interception code is a x B, after insertion, it may be a x bA x B, or A x Ba x B. At this time, the code to be replaced is deleted, and the final interface code with the intercepted code can be obtained.
The interception code provided by the embodiment of the application can be used for intercepting the message, and meanwhile, the code can ensure that the message transmitted currently can be normally transmitted to the next level page.
And S5, intercepting the currently transmitted message by using the interception code.
And intercepting the currently transmitted message by utilizing the interception code so that the user or the developer can continuously research and use the message.
The message transmission method provided by the application can effectively ensure the accuracy of the information intercepted by the page at a certain specified level.
Fig. 8 is a schematic structural diagram of a first embodiment of a message interception apparatus according to an embodiment of the present application, where the apparatus includes: the naming module 100 is used for naming the message interfaces corresponding to the pages of each hierarchy in the response chain to obtain the self-defined names of the message interfaces; a target page determining module 200, configured to determine a target page, where the target page is a page where a message capturing action is preset; a target message interface determining module 300, configured to determine a target message interface by combining the target page and the custom name of each message interface; a replacing module 400, configured to replace an interface code corresponding to the target message interface with an interception code, where the interception code is used to intercept a currently transmitted message and transmit the message to a next-level page of the target page; and the intercepting module 500 is configured to intercept the currently transmitted message by using the intercepting code.
Fig. 9 is a schematic structural diagram of a second embodiment of a message interception apparatus according to the embodiment of the present application, where the naming module 100 includes: an interface obtaining module 1001, configured to obtain a message interface corresponding to the page; a pre-naming module 1002, configured to pre-name the message interface to obtain a standby name of the message interface, where the standby name at least includes a name of the hierarchy information of the corresponding page; a deduplication module 1003 for replacing duplicate names, namely the same standby names used by more than one message interface, with available names, different from each of the standby names, resulting in custom names for each message interface.
Fig. 10 is a schematic structural diagram of a third embodiment of a message interception apparatus according to the embodiment of the present application, where the target page determining module 200 includes: a page level information obtaining module 2001, configured to obtain page level information in a preset interception instruction; a preselected page determining module 2002, configured to determine a preselected page according to the page level information, where the preselected page is all pages corresponding to the page level information; and the target page determining module 2003 is configured to determine a target page from all the preselected pages, where the target page is a preselected page where a contact is located, and the contact is a force point where the page receives a touch.
Fig. 11 is a schematic structural diagram of a fourth embodiment of a message interception apparatus according to the embodiment of the present application, where the target message interface determining module 300 includes: an information obtaining module 3001, configured to obtain a page level and page information of the target page; a matching module 3002, configured to match the page level of the target page with the custom name of each message interface; an interface determining module 3003, configured to determine a target message interface, where the target message interface is a message interface whose level information and page information in the custom name are matched with the page level and page information of the target page.
Fig. 12 is a schematic structural diagram of a fifth embodiment of a message interception apparatus according to an embodiment of the present application, where the replacing module 400 includes: a code determining module 4001, configured to determine a code to be replaced, where the code to be replaced is a code including a message name and parameter information to be transmitted in a message in an interface code; a code inserting module 4002, configured to insert the interception code into an inserting node of the interface code, where the inserting node is a node in the interface code that is adjacent to a first character or a last character in the code to be replaced; a code deleting module 4003, configured to delete the code to be replaced.
Fig. 13 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention, where the electronic device includes: a memory 101 and a processor 102;
a memory 101 for storing a computer program;
the processor 102 is configured to execute the computer program stored in the memory to implement the information pushing method in the foregoing embodiments. Reference may be made in particular to the description relating to the method embodiments described above.
Alternatively, the memory 101 may be separate or integrated with the processor 102.
When the memory 101 is a device independent of the processor 102, the electronic apparatus may further include:
a bus 103 for connecting the memory 101 and the processor 102.
The electronic device provided in the embodiment of the present invention may be configured to execute any of the message interception methods shown in the foregoing embodiments, and the implementation manner and the technical effect are similar, and details of the embodiment of the present invention are not described here.
An embodiment of the present invention further provides a readable storage medium, where a computer program is stored in the readable storage medium, and when at least one processor of a message sending apparatus executes the computer program, the message sending apparatus executes a message interception method described in any of the foregoing embodiments.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program described above may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention.

Claims (12)

1. A method for message interception, the method comprising:
naming message interfaces corresponding to each level of page in a response chain to obtain the self-defined names of the message interfaces, wherein the self-defined names corresponding to the message interfaces are different;
determining a target page, wherein the target page is a preset page in which a message intercepting action is generated;
determining a target message interface by combining the target page and the custom name of each message interface;
replacing an interface code corresponding to the target message interface with an interception code, wherein the interception code is used for intercepting a currently transmitted message and transmitting the message to a next-level page of the target page;
and intercepting the currently transmitted message by utilizing the interception code.
2. The method of claim 1, wherein obtaining the custom name of the message interface corresponding to the each level page in the named response chain comprises:
acquiring a message interface corresponding to the page;
pre-naming the message interface to obtain a standby name of the message interface, wherein the standby name at least comprises a name of the hierarchy information of the corresponding page;
replacing duplicate names, which are the same standby names used by more than one message interface, with available names, which are different names from each of the standby names, resulting in custom names for each message interface.
3. The method of claim 1, wherein determining the target page comprises:
acquiring page level information in a preset interception instruction;
determining a preselected page according to the page level information, wherein the preselected page is all pages corresponding to the page level information;
and determining a target page from all the preselected pages, wherein the target page is the preselected page where the contact points are located, and the contact points are stress points of the page for receiving touch.
4. The method of claim 2, wherein determining the target message interface in combination with the custom name of the target page and each message interface comprises:
acquiring the page level and page information of the target page;
matching the page level and the page information of the target page with the custom name of each message interface;
and determining a target message interface, wherein the target message interface is a message interface of which the hierarchy information and the page information in the custom name are matched with the page level and the page information of the target page.
5. The method of claim 1, wherein replacing the interface code corresponding to the target message interface with an interception code comprises:
determining a code to be replaced, wherein the code to be replaced is a code of an interface code, which contains a message name and parameter information to be transmitted in a message;
inserting the interception code into an insertion node of the interface code, wherein the insertion node is a node adjacent to a first character or a last character in the code to be replaced in the interface code;
and deleting the code to be replaced.
6. A message interception apparatus, the apparatus comprising:
the naming module is used for naming the message interfaces corresponding to the pages of each hierarchy in the response chain to obtain the self-defined names of the message interfaces, wherein the self-defined names corresponding to the message interfaces are different;
the target page determining module is used for determining a target page, wherein the target page is a preset page in which a message capturing action is generated;
the target message interface determining module is used for determining a target message interface by combining the target page and the custom name of each message interface;
the replacing module is used for replacing an interface code corresponding to the target message interface with an interception code, wherein the interception code is used for intercepting a currently transmitted message and transmitting the message to a next-level page of the target page;
and the interception module is used for intercepting the currently transmitted message by utilizing the interception code.
7. The apparatus of claim 6, wherein the naming module comprises:
the interface acquisition module is used for acquiring a message interface corresponding to the page;
the pre-naming module is used for pre-naming the message interface to obtain a standby name of the message interface, wherein the standby name at least comprises the name of the hierarchy information of the corresponding page;
and the duplication removing module is used for replacing the duplicate names which are the same standby names used by more than one message interface with the available names different from the standby names to obtain the self-defined names of the message interfaces.
8. The apparatus of claim 6, wherein the target page determining module comprises:
the page level information acquisition module is used for acquiring page level information in a preset interception instruction;
a preselected page determining module, configured to determine a preselected page according to the page level information, where the preselected page is all pages corresponding to the page level information;
and the target page determining module is used for determining a target page from all the preselected pages, wherein the target page is the preselected page where the contact points are located, and the contact points are stress points of the page for receiving touch.
9. The apparatus of claim 7, wherein the target message interface determining module comprises:
the information acquisition module is used for acquiring the page level and the page information of the target page;
the matching module is used for matching the page level of the target page with the custom name of each message interface;
and the interface determining module is used for determining a target message interface, wherein the target message interface is a message interface of which the hierarchy information and the page information in the custom name are matched with the page level and the page information of the target page.
10. The apparatus of claim 6, wherein the replacement module comprises:
the code determination module is used for determining a code to be replaced, wherein the code to be replaced is a code of an interface code, which contains a message name and parameter information to be transmitted in a message;
a code insertion module, configured to insert the interception code into an insertion node of the interface code, where the insertion node is a node in the interface code that is adjacent to a first character or a last character in the code to be replaced;
and the code deleting module is used for deleting the code to be replaced.
11. An electronic device, characterized in that the electronic device comprises:
a processor, and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the message interception method of any of claims 1-5 via execution of the executable instructions.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the message interception method of any one of claims 1 to 5.
CN201910872646.1A 2019-09-16 2019-09-16 Message interception method and device, electronic equipment and storage medium Active CN110597647B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910872646.1A CN110597647B (en) 2019-09-16 2019-09-16 Message interception method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910872646.1A CN110597647B (en) 2019-09-16 2019-09-16 Message interception method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110597647A CN110597647A (en) 2019-12-20
CN110597647B true CN110597647B (en) 2021-05-28

Family

ID=68859903

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910872646.1A Active CN110597647B (en) 2019-09-16 2019-09-16 Message interception method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110597647B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113254838B (en) * 2021-06-18 2021-10-01 每日互动股份有限公司 Message distribution method based on mesh cascade, electronic equipment and medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106126355A (en) * 2016-06-22 2016-11-16 百度在线网络技术(北京)有限公司 Event transmission method based on iOS system and device
CN106569900A (en) * 2016-10-28 2017-04-19 腾讯科技(深圳)有限公司 Application processing method and device
CN108228159A (en) * 2018-02-02 2018-06-29 中国银行股份有限公司 A kind of object interaction method and system based on response chain
CN108614739A (en) * 2016-12-12 2018-10-02 阿里巴巴集团控股有限公司 A kind of method and device for transmitting message
CN109144750A (en) * 2018-08-21 2019-01-04 武汉斗鱼网络科技有限公司 A kind of message treatment method, device, electronic equipment and storage medium
CN109298853A (en) * 2018-09-10 2019-02-01 武汉斗鱼网络科技有限公司 A kind of message treatment method, device, electronic equipment and storage medium
US10235216B1 (en) * 2009-10-15 2019-03-19 Ivanti, Inc. Modifying system-defined user interface control functionality on a computing device
CN109814942A (en) * 2018-12-19 2019-05-28 北京城市网邻信息技术有限公司 A kind of parameter processing method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10235216B1 (en) * 2009-10-15 2019-03-19 Ivanti, Inc. Modifying system-defined user interface control functionality on a computing device
CN106126355A (en) * 2016-06-22 2016-11-16 百度在线网络技术(北京)有限公司 Event transmission method based on iOS system and device
CN106569900A (en) * 2016-10-28 2017-04-19 腾讯科技(深圳)有限公司 Application processing method and device
CN108614739A (en) * 2016-12-12 2018-10-02 阿里巴巴集团控股有限公司 A kind of method and device for transmitting message
CN108228159A (en) * 2018-02-02 2018-06-29 中国银行股份有限公司 A kind of object interaction method and system based on response chain
CN109144750A (en) * 2018-08-21 2019-01-04 武汉斗鱼网络科技有限公司 A kind of message treatment method, device, electronic equipment and storage medium
CN109298853A (en) * 2018-09-10 2019-02-01 武汉斗鱼网络科技有限公司 A kind of message treatment method, device, electronic equipment and storage medium
CN109814942A (en) * 2018-12-19 2019-05-28 北京城市网邻信息技术有限公司 A kind of parameter processing method and device

Also Published As

Publication number Publication date
CN110597647A (en) 2019-12-20

Similar Documents

Publication Publication Date Title
CN108900353B (en) Fault warning method and terminal equipment
US9519401B2 (en) Providing context menu based on predicted commands
CN110262918B (en) Process crash analysis method and device, distributed equipment and storage medium
CN110489105B (en) Method, system and equipment for setting visual embedded point and storage medium thereof
CN110442502B (en) Point burying method, device, equipment and storage medium
US10084637B2 (en) Automatic task tracking
CN110716848A (en) Data collection method and device, electronic equipment and storage medium
CN111130987A (en) Automatic acquisition method and device for AWR report, electronic equipment and storage medium
CN108197002B (en) Mobile device non-buried point data statistical method, system, terminal and medium
CN114528517A (en) View processing method and device, electronic equipment and computer readable medium
US10205813B2 (en) Method and system for detecting abnormal contact information and server
CN107102950A (en) A kind of applied program testing method and device
CN110597647B (en) Message interception method and device, electronic equipment and storage medium
CN107506494B (en) Document handling method, mobile terminal and computer readable storage medium
CN112269706A (en) Interface parameter checking method and device, electronic equipment and computer readable medium
CN111309743A (en) Report pushing method and device
CN114862381A (en) Transfer method and device based on information sharing, electronic equipment and storage medium
JPWO2019186777A1 (en) Information processing equipment, control methods, and programs
CN109104481B (en) File integrity detection method, file integrity detection device and terminal equipment
CN108984238B (en) Gesture processing method and device of application program and electronic equipment
CN107908629B (en) Information query method, terminal and equipment
US11321277B2 (en) Apparatus and method for improved network data security enforcement and verification
CN111127094B (en) Account matching method and device, electronic equipment and storage medium
CN112181535A (en) Interface calling method, device, server and storage medium
CN109739812A (en) Method and device for displaying resource files

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