CN112351059A - Request processing method and device, electronic equipment and computer-readable storage medium - Google Patents

Request processing method and device, electronic equipment and computer-readable storage medium Download PDF

Info

Publication number
CN112351059A
CN112351059A CN202010765080.5A CN202010765080A CN112351059A CN 112351059 A CN112351059 A CN 112351059A CN 202010765080 A CN202010765080 A CN 202010765080A CN 112351059 A CN112351059 A CN 112351059A
Authority
CN
China
Prior art keywords
request
data
processing
rule
processing method
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.)
Granted
Application number
CN202010765080.5A
Other languages
Chinese (zh)
Other versions
CN112351059B (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN202010765080.5A priority Critical patent/CN112351059B/en
Publication of CN112351059A publication Critical patent/CN112351059A/en
Application granted granted Critical
Publication of CN112351059B publication Critical patent/CN112351059B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • 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]
    • 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/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • 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/133Protocols for remote procedure calls [RPC]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application provides a request processing method and device, electronic equipment and a computer readable storage medium, wherein the request processing method comprises the following steps: receiving a request; screening the request based on preset configuration information; and when the preset rule matched with the request exists in the configuration information, processing the request corresponding to the preset rule matched with the request.

Description

Request processing method and device, electronic equipment and computer-readable storage medium
Technical Field
The embodiment of the application relates to the technical field of internet, in particular to a request processing method and device, electronic equipment and a computer readable storage medium.
Background
The Internet of things provides a general platform (namely an Internet of things service platform) related to 'things' and 'things', and the general platform has equipment access capability, communication capability, general service capability and storage capability of different equipment with different protocols.
The Internet of things can be connected with various devices of different types of different manufacturers. After the equipment is accessed, the internet of things service platform provides general services, such as general read-write capability, general reporting or setting capability, general event notification capability and the like, usually does not analyze and process the request of the equipment, only performs general storage and communication, and is automatically analyzed by an associated object. But in some scenarios special handling of the device's request is required.
Disclosure of Invention
The embodiment of the application provides a request processing method and device, electronic equipment and a computer readable storage medium.
In a first aspect, an embodiment of the present application provides a request processing method, including: receiving a request; screening the request based on preset configuration information; and when the preset rule matched with the request exists in the configuration information, processing the request corresponding to the preset rule matched with the request.
In a second aspect, an embodiment of the present application provides an electronic device, including: at least one processor; and a memory having at least one program stored thereon, the at least one program, when executed by the at least one processor, causing the at least one processor to implement any of the request processing methods described above.
In a third aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements any one of the request processing methods described above.
The request processing method provided by the embodiment of the application screens the request based on the preset configuration information, and when the preset rule matched with the request exists in the configuration information, the request is processed corresponding to the preset rule matched with the request, so that the request is monitored, the request meeting specific conditions is correspondingly processed, and the special processing of the request is realized.
Drawings
FIG. 1 is a flow chart of a request processing method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a request processing procedure provided in an embodiment of the present application;
fig. 3 is a block diagram of a request processing device according to another embodiment of the present application.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present application, the request processing method and apparatus, the electronic device, and the computer-readable storage medium provided in the present application are described in detail below with reference to the accompanying drawings.
Example embodiments will be described more fully hereinafter with reference to the accompanying drawings, but which may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The embodiments and features of the embodiments of the present application may be combined with each other without conflict.
As used herein, the term "and/or" includes any and all combinations of at least one of the associated listed items.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. 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 at least one other feature, integer, step, operation, element, component, and/or group thereof.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and the present application and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
In some scenarios, special handling of the device's request is required.
For example, when a certain device has different requirements or insufficient capabilities, a device manufacturer requires the internet of things service platform to provide special processing for certain data, that is, when the device has a special business scenario, the internet of things service platform is required to perform special processing (such as data conversion, command conversion, event generation, etc.) for certain specific data in a request.
If a certain device needs to report positioning information, but the device is a simple device, does not support Global Positioning System (GPS) positioning, but can acquire Wireless Fidelity (WiFi) information and base station information, and it is expected that the service platform of the internet of things provides WiFi information and/or base station information that is reported to be converted into longitude and latitude information, and further can calculate or display the information at the other end;
if a certain device demands, and the reported electric quantity of the device is required to be lower than a certain threshold (such as 20), the internet of things service platform informs the associated device of sending out a low-electricity alarm notice.
For another example, when the equipment provider has its own server and wants that the equipment requests a certain service from the internet of things service platform and carries certain specific keyword data, the internet of things service platform can forward the request to the server of the equipment provider, so that the equipment provider can implement its own business processing.
Although the request processing method is provided based on the requirements of the internet of things service platform, the request processing method is also applicable to any other scene needing special processing of the request, is not limited to the field of the internet of things, is not limited to the field of the server side, and is also applicable to terminal services (modules, applications and the like) with the same requirements. For example, when a certain application of the terminal is used as a total access module interfacing with a service, if different requests are received, the requests need to be distributed to other service modules or other sub-modules of the application itself for processing, the request processing method of the embodiment of the present application may also be adopted.
Fig. 1 is a flowchart of a request processing method according to an embodiment of the present application.
In a first aspect, referring to fig. 1, an embodiment of the present application provides a request processing method, including:
step 100, receiving a request.
In some exemplary embodiments, the request may be a request that the other device itself sends to the current device (execution subject), or may be a request that the other device itself does not send to the current device, but requires the other device to send to the current device due to some special requirement. For example, for the internet of things, the current device may be an internet of things server, and the other devices may be any one of the devices in the internet of things.
In some exemplary embodiments, data may be included in the request. In other exemplary embodiments, the request may not include data.
In some exemplary embodiments, the data included in the request may be data in any format. For example, data in JSON Object Notation (JSON) format may be used. JSON is a lightweight data interchange format that contains two representation structures, object (jsonoobject) and array (jsonoarray).
Jsonoobject starts with "{" left braces and ends with "}" right braces, the middle part is made up of one or more pairs of "," separate "keys (key), value", and between key and value with ": "partition, key is a string, value can be a string, value, true, false, null, object or array, etc. For example, a jsonoobject is expressed as follows:
{
key1:value1,
key2:value2,
……
}
the jsonoarray begins with a "[" left middle bracket and ends with a "]" right middle bracket, the middle including one or more jsonoobjects. For example, a JSONArray is represented as follows:
[
{
key1:value1,
key2:value2
}
{
Key3:value3,
Key4:value4
}
]
in some exemplary embodiments, the receipt of the requests is actually a monitoring of the received requests, i.e., each request performs a subsequent rule matching.
Step 101, screening the request based on preset configuration information.
In some exemplary embodiments, the configuration information includes a preset rule.
In other exemplary embodiments, the configuration information includes: and presetting a corresponding relation between the rule and the target information.
In some exemplary embodiments, the correspondence between the target information and the preset rule may be a one-to-one relationship. In other exemplary embodiments, the correspondence between the target information and the preset rule may also be a one-to-many relationship. In other exemplary embodiments, the correspondence between the target information and the preset rule may also be a many-to-one relationship. In other exemplary embodiments, the correspondence between the target information and the preset rule may also be a many-to-many relationship.
It should be noted that all the corresponding relationships can be set to be a one-to-one relationship, a one-to-many relationship, a many-to-one relationship, or a many-to-many relationship; or a part of corresponding relations are one-to-one relations, and the other part of corresponding relations are one-to-many relations; or a part of corresponding relations are one-to-one relations, and the other part of corresponding relations are many-to-one relations; and the like, which are not limited in the embodiments of the present application.
As shown in fig. 2, in some exemplary embodiments, the preset rule may include: and (4) data rules. In other exemplary embodiments, the preset rule may also include: a rule is requested. In other exemplary embodiments, the preset rule may also include: data rules and request rules.
That is, only the data rule may be set, only the request rule may be set, or both the data rule and the request rule may be set.
It should be noted that, in the corresponding relationship, the preset rule in all the corresponding relationships may be set to include only the data rule; or setting the preset rules in all the corresponding relations to only comprise request rules; or setting preset rules in all the corresponding relations to include data rules and request rules; or setting that the preset rule in one part of the corresponding relation only comprises a data rule, and the preset rule in the other part of the corresponding relation only comprises a request rule; or setting that the preset rule in one part of the corresponding relation only comprises a data rule, and setting that the preset rule in the other part of the corresponding relation comprises a data rule and a request rule; or setting that the preset rule in one part of the corresponding relation only comprises the request rule, and setting that the preset rule in the other part of the corresponding relation comprises the data rule and the request rule; or setting that the preset rule in one part of the corresponding relation only comprises a data rule, the preset rule in the other part of the corresponding relation only comprises a request rule, and the preset rule in the other part of the corresponding relation comprises a data rule and a request rule; the embodiments of the present application do not limit this.
In some exemplary embodiments, the data rules include at least one of: data keywords, regular expressions of data.
In some exemplary embodiments, when the data is data in JSON format, the data key may be a data key in JSON format. When the data is in other formats, the data key may also be in other formats. The embodiment of the present application does not limit the specific format of the data.
In some exemplary embodiments, the JSON formatted data keys may include keys with paths, or keys without paths. For example, the keywords with paths are device/location/wifi, device/battery, etc.
In some exemplary embodiments, the target information includes at least enough information that one process can be identified, i.e., the target information and the corresponding process are in a one-to-one correspondence, and the specific implementation can be freely defined by the implementer. For example, the target information includes any one of: an identification parameter of processing corresponding to the target information, an identification parameter of the processing module; the processing module is used for realizing processing corresponding to the target information.
In some exemplary embodiments, the identification parameter comprises any one of:
identifier, name, address, identity information.
In some exemplary embodiments, the processing module comprises any one of:
plug-ins, components, servers, instance objects, interfaces.
In some exemplary embodiments, screening the request based on the preset configuration information refers to determining whether a preset rule matching the request exists in the configuration information.
It should be noted that, in one corresponding relationship, if only one data rule and one request rule are set, only the request is matched with the preset rule when the request is screened. For example, if only request rules are set, this indicates that such requests are screened out regardless of the data contained in the request; if only the data rule is set, all the requests are screened as long as the data contained in the requests meet the data rule; if the request rule and the data rule are set, the request is required to meet the request rule, and the data contained in the request is screened out only if the data meets the data rule.
In some exemplary embodiments, the request rule includes at least one of: a request key, or a requested regular expression.
In particular, when matching the request with the request rule, the unique identifier representing the request may be matched with the request rule. For example, for hypertext Transfer Protocol (HTTP) or hypertext Transfer security Protocol (HTTPs), the unique Identifier indicating the request may be a Universal Resource Identifier (URI); as another example, for a subscription schema, the unique identification representing the request may be a subscription topic (topic), and so on.
And 102, when the preset rule matched with the request exists in the configuration information, processing the request corresponding to the preset rule matched with the request.
In some exemplary embodiments, as shown in fig. 2, when the preset rule includes a request rule, the presence of the preset rule matching the request in the configuration information includes: the configuration information contains a request rule matched with the unique identification representing the request;
when the preset rule comprises a data rule, the preset rule matched with the request in the configuration information comprises: there are data rules in the configuration information that match the data in the request.
In some exemplary embodiments, the processing the request corresponding to the preset rule matching the request includes:
acquiring target information corresponding to the preset rule matched with the request according to the corresponding relation between the preset rule and the target information; and carrying out corresponding processing on the request according to the obtained target information.
In some exemplary embodiments, the corresponding relationship may be included in the configuration information, and if the configuration information only includes a preset rule, the corresponding relationship should be additionally configured, and the preset rule in the configuration information and the preset rule in the corresponding relationship should be kept consistent.
In some exemplary embodiments, when the preset rule includes: when the data rule is used, the acquiring of the target information corresponding to the preset rule matched with the request comprises the following steps: and acquiring target information corresponding to the data rule matched with the data in the request.
In other exemplary embodiments, when the preset rule includes: when a rule is requested, acquiring target information corresponding to the rule matched with the request comprises the following steps: target information corresponding to a request rule matching the unique identifier representing the request is obtained.
In other exemplary embodiments, when the preset rule includes: when the data rule and the request rule are used, the step of acquiring the target information corresponding to the rule matched with the request comprises the following steps: the method includes acquiring a request rule matching a unique identifier representing the request and target information corresponding to a data rule matching data in the request.
In some exemplary embodiments, the processing of the request is other processing than general processing.
In some exemplary embodiments, the general processing refers to processing that the current device itself has, i.e., normal processing, and the other processing different from the general processing refers to processing that the current device itself does not have, i.e., special processing that requires certain requests, such as at least one of differential demand processing (e.g., data conversion), adaptation processing (e.g., data conversion), additional processing (e.g., at least one of request forwarding, request notification, request synchronization), and the like.
In some exemplary embodiments, as shown in fig. 2, the processing includes at least one of:
processing the request;
processing of data in the request.
In some exemplary embodiments, the processing of the request includes at least one of:
request conversion, request forwarding, request notification and request synchronization;
the processing of the data in the request includes at least one of:
data conversion and data storage.
In some exemplary embodiments, data conversion refers to converting data in a request to other data. For example, when the data in the request is matched with the data rule device/location/wifi, the data in the request is converted into GPS data, namely longitude and latitude information.
In some exemplary embodiments, request translation refers to translating a request into other requests. For example, when the data in the request is matched with the data rule device/game, whether the data in the request meets the condition (such as whether the data is less than or equal to 20%) is judged, if the data in the request meets the condition, a notification request (such as a low-power alarm notification request) is generated, and the notification request is sent to the relevant equipment.
In some exemplary embodiments, request forwarding or request notification or request synchronization refers to forwarding a request to a specified device. In specific implementation, the request may be forwarded to the specified device only, or the request and data in the request may be forwarded to the specified device, or only the data in the request may be forwarded to the specified device, or another request may be sent to the specified device according to the request and/or the data in the request. For example, when the request matches the request rule device/online, the request is forwarded to the server of the equipment provider so that the online condition of the equipment can be viewed and counted on the server of the equipment.
In some exemplary embodiments, when the target information is an identification parameter of the processing module, performing corresponding processing on the request according to the obtained target information includes:
determining a processing module corresponding to the obtained target information, sending the request to the determined processing module, and processing the request by the determined processing module;
or determining a processing module corresponding to the obtained target information, and processing the request by referring to the determined processing module.
In some exemplary embodiments, the reference may be a direct call, a request placed in a request-sending queue, or a call by way of a remote request.
In some exemplary embodiments, when there is no preset rule matching the request in the configuration information, the request is processed by a general process or a default process.
In some exemplary embodiments, before the screening the request based on the preset configuration information, the method further includes: configuring configuration information; or configuring the configuration information and the corresponding relation between the preset rule and the target information.
In some exemplary embodiments, when configuring the corresponding relationship, it is necessary to configure the target information and the preset rule first, and then configure the corresponding relationship between the target information and the preset rule.
In some exemplary embodiments, the corresponding relationship may be configured through an interactive interface, may be preconfigured at factory, or may be configured through a registration manner or an interface manner.
In some exemplary embodiments, after the configuration of the corresponding relationship is completed, the corresponding relationship may not be changed, or may be changed and then synchronously validated.
The request processing method provided by the embodiment of the application screens the request based on the preset configuration information, and when the preset rule matched with the request exists in the configuration information, the request is processed corresponding to the preset rule matched with the request, so that the request is monitored, the request meeting specific conditions is correspondingly processed, and the special processing of the request is realized.
The request processing method provided by the embodiment of the application realizes monitoring on data abnormity, unreasonable request and the like, realizes differential processing, adaptability processing, distribution processing, additional processing, newly-added request processing and the like on special service data through the processing method, solves the processing requirements of the difference, and realizes modularization, independence and plug-in of each requirement processing without damaging platform service or the universality of terminal service.
The following describes in detail a specific implementation procedure of the request processing method according to the embodiment of the present application by using a specific example, and the example is only for convenience of description and is not used to limit the protection scope of the embodiment of the present application.
Example 1
In this example, a service reporting interface of a certain service platform (i.e., a server) stores all reported attribute data; however, the reported wifi information needs to be subjected to unified longitude and latitude conversion, and the longitude and latitude information obtained through conversion is stored, so that an address display party can directly display the longitude and latitude information by using map software.
1. And configuring the corresponding relation among the request rule, the data rule and the target information.
The correspondence set in this example is shown in table 1.
TABLE 1
Object information Request rules Data rules
location */report/* device/loc_wifi
In this example, the target information is set as the unique identifier location of the processing plug-in, the request rule is set as ". multidrop/. multidrop", and the data rule is set as "device/loc _ wifi".
In this example, "/" is used as a separator, and the separator can be self-defined, and the matching strength can also be self-defined.
If the request rule/report/represents that the unique identifier representing the request contains a report keyword, screening the request rule/report, and if the unique identifier representing the request contains the report keyword;
if the data rule "device/loc _ wifi" indicates that, in the reported JSON-formatted data, if the data report contains the keyword with the path being device- > loc _ wifi, the data is screened out, and if the JSON-formatted data reported at a certain time is as follows:
Figure BDA0002610521150000071
two pieces of WiFi information of the reported data representation device in the JSON format are provided, where one piece of WiFi information includes:
media Access Control (MAC) address: 74:4a: a4: e6: b3: c 0;
signal strength (sig): 0;
service Set Identifier (SSID): 801ZTa-E6B3C 0;
noise (noise): 0;
age (age): 0;
another WiFi information includes:
MAC address: 0e:74:9c:65: ca: a 6;
signal strength (sig): 0;
noise: 0;
age: 0.
the path can also be defined by itself, and even the expression mode of the array can be added, such as device/loc _ WiFi/[0]/MAC, which indicates that the reported WiFi information, and the first WiFi information has the MAC address.
2. The report interface receives a request of a client, wherein the request comprises the following data:
Figure BDA0002610521150000081
matching the request rule ". multidrop/. multidrop" with the request, matching the data rule "device/loc _ wifi" with the data in the request, referring the request to "location", and processing the request by the location.
3. Treatment of
In this example, "location" is an identifier of a plug-in, and after a request is referred (including direct call, request command sending queue, remote request, and other various ways) to a processing plug-in with an identifier of location, the plug-in with an identifier of location performs real wifi information to latitude and longitude information conversion. After the conversion, the plug-in with the identifier of location may be directly stored, or the plug-in with the identifier of location may transfer the request stream to the original platform for general processing (such as storage), and the transfer mode is not limited, and may be any mode, such as queue transfer, callback, remote call, and the like, as well as "reference", and is not limited.
location can also be a jar package, a separate plug-in service, even a separate external service, or an internal method.
Example 2
In this example, a service reporting interface of a certain service platform (i.e., a server) stores all reported attribute data; however, the reported electric quantity needs to be screened in low power, and under the condition of low power, a notice needs to be sent to some terminals.
S10: configuration of
1. And configuring the corresponding relation among the request rule, the data rule and the target information.
The correspondence set in this example is shown in table 2.
TABLE 2
Object information Request rules Data rules
project_default_plugin */report/* device/battery
The target information is set as unique identifier project _ default _ plugin of the processing plug-in this example, the request rule is set as "port/report/, and the data rule is set as" device/battery ".
In this example, "/" is used as a separator, and the separator can be self-defined, and the matching strength can also be self-defined.
If the request rule/report/represents that the unique identifier representing the request contains a report keyword, screening the request rule/report, and if the unique identifier representing the request contains the report keyword;
for example, in the data rule, "device/basic" indicates that, in the reported JSON-formatted data, if data including a device- > basic keyword is reported, the data is screened, and for example, the JSON-formatted data reported at a certain time is as follows:
Figure BDA0002610521150000091
the reported data in the JSON format represents 80% of the remaining power of the device.
The paths can also be defined by themselves, and even the expression of arrays can be added, in this example, the array mode is not needed.
2. The report interface receives a request of a client, wherein the request comprises the following data:
Figure BDA0002610521150000092
matching the request rule 'home/report' with the request, matching the data rule 'device/basic' with the data in the request, referring the request to 'project _ default _ plug', and processing by the project _ default _ plug.
3. Treatment of
In this example, "project _ default _ plugin" is an identifier of a plugin, and after a request is referred to (including various ways such as direct call, request command transmission queue, remote request, and the like) the plugin with the identifier of project _ default _ plugin, the plugin with the identifier of project _ default _ plugin determines whether the remaining power is lower than a preset threshold, and if the remaining power is lower than the preset threshold, the plugin with the identifier of project _ default _ plugin requests to transmit or broadcast a notification (notification) request to the service platform. Meanwhile, the plug-in with the identifier of "project _ default _ plugin" stores the electric quantity, or transfers the original request to the original service platform for general processing (such as storage), and the transfer mode is not limited, and can be any mode such as queue transfer, callback, remote call and the like, and is not limited like "reference".
The processing plug-in with the unique identifier "project _ default _ plugin" can process other services besides the low power determination service, even example 1, example 2, etc., which can be processed by the same "processing plug-in".
Example 3
In this example, when a device accesses a service of a service platform (i.e., a server), a device manufacturer desires that the service platform can forward some or all requests of such device to a backend server of the device manufacturer, so that the device manufacturer can perform business processing such as statistics and data viewing of the device manufacturer. For example, the device manufacturer wants to subscribe the status report information of the device to the service platform, so that the device manufacturer can count the online and offline device data in its own background.
1. And configuring the corresponding relation among the request rule, the data rule and the target information.
The correspondence set in this example is shown in table 3.
TABLE 3
Object information Request rules Data rules
https://*.*.*.*:443/report */report/* device/status
The target information set in this example is the unique identifier https:///. gtartj443/report of the processing server, the request rule set is ". cndot./report/. and the data rule set is" device/status ".
In this example, "/" is used as a separator, and the separator can be self-defined, and the matching strength can also be self-defined.
If the request rule/report/represents that the unique identifier representing the request contains a report keyword, screening the request rule/report, and if the unique identifier representing the request contains the report keyword;
for example, in the data rule, "device/status" indicates that, in the reported JSON-formatted data, if the reported data includes a data report whose path is a device- > status keyword, the data is screened out, for example, the JSON-formatted data reported at a certain time is as follows:
Figure BDA0002610521150000101
and the reported data in the JSON format represents that the equipment is in an online state.
2. The report interface receives a request of a client, wherein the request comprises the following data:
Figure BDA0002610521150000102
then request rule ". times./report/. times" is matched with the request, data rule "device/status" is matched with the data in the request, request rule ". times./report/. times" is matched with the request, data rule "device/basic" is matched with the data in the request, the request is remotely requested to the server "https:/. times.: 443/report" on the device, and the request is processed by the service corresponding to https:/. times. times.: 443/report.
3. Treatment of
443/report, which is a background server of the device manufacturer, and stores the state data of the device after receiving the state data, so as to display and count the state information of the device subsequently.
In this example, the request need not be "callback," which is purely asynchronous synchronization and forwarding of requests.
Example 4
This example describes a certain application of the terminal, and it is necessary to implement distribution processing for all requests according to the content thereof. Different data, processed by different modules or applications.
And configuring the corresponding relation among the request rule, the data rule and the target information.
The correspondence set in this example is shown in table 4.
TABLE 4
Figure BDA0002610521150000111
The data are shown schematically.
Three corresponding relationship items are provided in this example. The first piece of target information set corresponding to the relationship item is a unique identifier com.demo.blue tooth of the processing module, the set request rule is 'connect', and the set data rule is '/blue tooth'; the second piece of target information set corresponding to the relationship item is a unique identifier com.demo.wifi of the processing module, the set request rule is 'connect', and the set data rule is '/wifi'; the target information set by the third corresponding relation item is the unique identifier https:///. once. times.443/response of the processing server, the request rule set is "response", and the data rule set is default.
2. If the application receives a connect type request, the data in the request is:
Figure BDA0002610521150000112
the request is transmitted to the bluetooth module (i.e., the processing module with the unique identifier com.
If the application receives a connect type request, the data in the request is:
Figure BDA0002610521150000113
the request is transmitted to the WIFI module (i.e. the processing module with the unique identifier com.
Meanwhile, the processing results of all modules can be monitored, and if the response (response) results are reported, the processing results are uniformly fed back to the processing server with the unique identifier of https://. multidot. multidot.: 443/response through the application.
3. Treatment of
The example has two processing modules and one processing server, each of which completes its own business logic.
In a second aspect, an embodiment of the present application provides an electronic device, including:
at least one processor;
and a memory having at least one program stored thereon, the at least one program, when executed by the at least one processor, causing the at least one processor to implement any of the request processing methods described above.
Wherein, the processor is a device with data processing capability, which includes but is not limited to a Central Processing Unit (CPU) and the like; memory is a device with data storage capabilities including, but not limited to, random access memory (RAM, more specifically SDRAM, DDR, etc.), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), FLASH memory (FLASH).
In some embodiments, the processor, memory, and in turn other components of the computing device are connected to each other by a bus.
In a third aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements any one of the request processing methods described above.
Fig. 3 is a block diagram of a request processing device according to another embodiment of the present application.
In a fourth aspect, referring to fig. 3, another embodiment of the present application provides a request processing apparatus, including:
a request monitoring module 301, configured to receive a request; screening the request based on preset configuration information;
a request processing module 302, configured to, when a preset rule matching the request exists in the configuration information, perform processing corresponding to the preset rule matching the request on the request.
In some exemplary embodiments, the request processing module 302 is specifically configured to perform the processing corresponding to the preset rule matching the request on the request in the following manner:
acquiring target information corresponding to the preset rule matched with the request according to the corresponding relation between the preset rule and the target information; and carrying out corresponding processing on the request according to the obtained target information.
In some exemplary embodiments, the target information is in a one-to-one correspondence with the corresponding processes.
In some exemplary embodiments, the target information includes any one of:
an identification parameter of processing corresponding to the target information, an identification parameter of the processing module; the processing module is used for realizing processing corresponding to the target information.
In some exemplary embodiments, the identification parameter comprises any one of:
identifier, name, address, identity information.
In some exemplary embodiments, the processing module comprises any one of:
plug-ins, components, servers, instance objects, interfaces.
In some exemplary embodiments, the processing includes at least one of:
processing the request;
processing of data in the request.
In some exemplary embodiments, the processing of the request includes at least one of: request conversion, request forwarding, request notification and request synchronization;
the processing of the data in the request includes at least one of:
data conversion and data storage.
In some exemplary embodiments, the preset rule includes at least one of: data rules, request rules.
In some exemplary embodiments, when the preset rule includes a request rule, the presence of the preset rule matching the request in the configuration information includes: the configuration information contains a request rule matched with the unique identification representing the request;
when the preset rule comprises a data rule, the preset rule matched with the request in the configuration information comprises: there are data rules in the configuration information that match the data in the request.
In some exemplary embodiments, the request rule includes at least one of: a request keyword, a requested regular expression.
In some exemplary embodiments, the data rules include at least one of: data keywords, regular expressions of data.
In some exemplary embodiments, the data key comprises: with a key for the path.
In some exemplary embodiments, when the target information is a processing module unique identifier for implementing a process or a name uniquely representing a processing module for implementing a process, the request processing module 302 includes: determining a sub-module and at least one processing module;
the determining submodule is used for acquiring target information corresponding to the preset rule matched with the request in the corresponding relation between the preset rule and the target information when the preset rule matched with the request exists in the configuration information; determining a processing module corresponding to the obtained target information, and sending the request to the determined processing module; or determining a processing module corresponding to the obtained target information, and quoting the determined processing module;
and the processing module is used for processing the request.
The specific implementation process of the request processing apparatus is the same as that of the request processing method in the foregoing embodiment, and is not described here again.
It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by the computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted in a generic and descriptive sense only and not for purposes of limitation. In some instances, features, characteristics and/or elements described in connection with a particular embodiment may be used alone or in combination with features, characteristics and/or elements described in connection with other embodiments, unless expressly stated otherwise, as would be apparent to one skilled in the art. Accordingly, 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 scope of the application as set forth in the appended claims.

Claims (13)

1. A request processing method, comprising:
receiving a request;
screening the request based on preset configuration information;
and when the configuration information has a preset rule matched with the request, performing processing corresponding to the preset rule matched with the request on the request.
2. The request processing method according to claim 1, wherein the processing of the request corresponding to the preset rule matching the request comprises:
acquiring target information corresponding to a preset rule matched with the request according to the corresponding relation between the preset rule and the target information; and correspondingly processing the request according to the obtained target information.
3. The request processing method according to claim 2, wherein the target information is in a one-to-one correspondence with the corresponding processing.
4. The request processing method according to claim 2 or 3, wherein the target information includes any one of:
an identification parameter of processing corresponding to the target information, an identification parameter of a processing module; the processing module is used for realizing processing corresponding to the target information.
5. The request processing method of claim 4, wherein the identification parameter comprises any one of:
identifier, name, address, identity information.
6. The request processing method according to claim 4, wherein the processing module comprises any one of:
plug-ins, components, servers, instance objects, interfaces.
7. The request processing method of claim 1, wherein the processing comprises at least one of:
processing the request;
processing the data in the request.
8. The request processing method of claim 7, wherein the processing of the request comprises at least one of: request conversion, request forwarding, request notification and request synchronization;
the processing of the data in the request includes at least one of:
data conversion and data storage.
9. The request processing method according to any one of claims 1-3, 7-8, wherein the preset rule comprises at least one of: data rules, request rules.
10. The request processing method according to claim 9, wherein, when the preset rule includes the request rule, the presence of the preset rule matching the request in the configuration information includes: a request rule matched with the unique identification representing the request exists in the configuration information;
when the preset rule includes the data rule, the existence of the preset rule matched with the request in the configuration information includes: data rules matching the data in the request exist in the configuration information.
11. The request processing method of claim 9, wherein the data rules include at least one of:
regular expressions of data keywords and data; wherein the data key comprises: a keyword with a path;
the request rule includes at least one of: a request keyword, a requested regular expression.
12. An electronic device, comprising:
at least one processor;
memory having stored thereon at least one program which, when executed by the at least one processor, causes the at least one processor to carry out a request processing method according to any one of claims 1-11.
13. A computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a request processing method according to any one of claims 1-11.
CN202010765080.5A 2020-07-30 2020-07-30 Request processing method and device, electronic equipment and computer-readable storage medium Active CN112351059B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010765080.5A CN112351059B (en) 2020-07-30 2020-07-30 Request processing method and device, electronic equipment and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010765080.5A CN112351059B (en) 2020-07-30 2020-07-30 Request processing method and device, electronic equipment and computer-readable storage medium

Publications (2)

Publication Number Publication Date
CN112351059A true CN112351059A (en) 2021-02-09
CN112351059B CN112351059B (en) 2021-09-10

Family

ID=74357572

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010765080.5A Active CN112351059B (en) 2020-07-30 2020-07-30 Request processing method and device, electronic equipment and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN112351059B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112860463A (en) * 2021-03-22 2021-05-28 平安商业保理有限公司 Service request forwarding method and device, computer equipment and readable storage medium

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102638356A (en) * 2011-12-30 2012-08-15 北京四达时代软件技术股份有限公司 Method, device and system for processing service data
CN106385397A (en) * 2015-07-31 2017-02-08 腾讯科技(深圳)有限公司 Network access equipment access control and type configuration method and apparatus thereof
CN106557030A (en) * 2015-09-25 2017-04-05 华为技术有限公司 Method of instructing operation and device based on entity
CN107465693A (en) * 2017-09-18 2017-12-12 北京小度信息科技有限公司 Request message treating method and apparatus
US20180131593A1 (en) * 2016-11-07 2018-05-10 Hughes Network Systems, Llc Application characterization using transport protocol analysis
CN108449418A (en) * 2018-03-29 2018-08-24 新华三云计算技术有限公司 A kind of mixed cloud platform management system and method
CN108897691A (en) * 2018-06-29 2018-11-27 百度在线网络技术(北京)有限公司 Data processing method, device, server and medium based on interface analog service
CN108989365A (en) * 2017-05-31 2018-12-11 腾讯科技(深圳)有限公司 A kind of information processing method, server, terminal device and storage medium
CN109635019A (en) * 2018-10-23 2019-04-16 平安科技(深圳)有限公司 Request processing method, device, equipment and storage medium
CN109639840A (en) * 2019-02-25 2019-04-16 网宿科技股份有限公司 A kind of data processing method and edge calculations system based on edge calculations
CN109815013A (en) * 2019-01-02 2019-05-28 深圳壹账通智能科技有限公司 Business data processing method, device, computer equipment and storage medium
CN110457382A (en) * 2019-08-12 2019-11-15 中国联合网络通信集团有限公司 Method for processing business and equipment
CN110610352A (en) * 2019-09-16 2019-12-24 中国铁塔股份有限公司 Flow processing method and device, electronic equipment and computer readable storage medium
CN111209094A (en) * 2018-11-21 2020-05-29 北京小桔科技有限公司 Request processing method and device, electronic equipment and computer readable storage medium
CN111324843A (en) * 2020-02-17 2020-06-23 政采云有限公司 Front-end request processing method, device, equipment and readable storage medium

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102638356A (en) * 2011-12-30 2012-08-15 北京四达时代软件技术股份有限公司 Method, device and system for processing service data
CN106385397A (en) * 2015-07-31 2017-02-08 腾讯科技(深圳)有限公司 Network access equipment access control and type configuration method and apparatus thereof
CN106557030A (en) * 2015-09-25 2017-04-05 华为技术有限公司 Method of instructing operation and device based on entity
US20180131593A1 (en) * 2016-11-07 2018-05-10 Hughes Network Systems, Llc Application characterization using transport protocol analysis
CN108989365A (en) * 2017-05-31 2018-12-11 腾讯科技(深圳)有限公司 A kind of information processing method, server, terminal device and storage medium
CN107465693A (en) * 2017-09-18 2017-12-12 北京小度信息科技有限公司 Request message treating method and apparatus
CN108449418A (en) * 2018-03-29 2018-08-24 新华三云计算技术有限公司 A kind of mixed cloud platform management system and method
CN108897691A (en) * 2018-06-29 2018-11-27 百度在线网络技术(北京)有限公司 Data processing method, device, server and medium based on interface analog service
CN109635019A (en) * 2018-10-23 2019-04-16 平安科技(深圳)有限公司 Request processing method, device, equipment and storage medium
CN111209094A (en) * 2018-11-21 2020-05-29 北京小桔科技有限公司 Request processing method and device, electronic equipment and computer readable storage medium
CN109815013A (en) * 2019-01-02 2019-05-28 深圳壹账通智能科技有限公司 Business data processing method, device, computer equipment and storage medium
CN109639840A (en) * 2019-02-25 2019-04-16 网宿科技股份有限公司 A kind of data processing method and edge calculations system based on edge calculations
CN110457382A (en) * 2019-08-12 2019-11-15 中国联合网络通信集团有限公司 Method for processing business and equipment
CN110610352A (en) * 2019-09-16 2019-12-24 中国铁塔股份有限公司 Flow processing method and device, electronic equipment and computer readable storage medium
CN111324843A (en) * 2020-02-17 2020-06-23 政采云有限公司 Front-end request processing method, device, equipment and readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112860463A (en) * 2021-03-22 2021-05-28 平安商业保理有限公司 Service request forwarding method and device, computer equipment and readable storage medium

Also Published As

Publication number Publication date
CN112351059B (en) 2021-09-10

Similar Documents

Publication Publication Date Title
US11750702B2 (en) Subscription and notification service
US20230319534A1 (en) Cross-resource subscription for m2m service layer
US20200344189A1 (en) Communication method and communication apparatus
US10575153B2 (en) Enhanced operations between service layer and management layer in an M2M system by allowing the execution of a plurality of commands on a plurality of devices
CN107517438B (en) Method for requesting sharing of Bluetooth device, electronic device and computer storage medium
US9753794B2 (en) Method and apparatus for controlling sending of heartbeat signal
US8719332B2 (en) Method and system for content categorization
US10827022B2 (en) Semantics based content specification of IoT data
US11108648B2 (en) Information processing method in M2M and apparatus
US11671514B2 (en) Service layer message templates in a communications network
US10999357B1 (en) Data transmission system and data transmission method
CN112351059B (en) Request processing method and device, electronic equipment and computer-readable storage medium
US10225367B2 (en) Method and device for generating forwarding information
CN112019604B (en) Edge data transmission method and system
CN113315689B (en) Information processing method, system, electronic device and readable storage medium
WO2023221404A1 (en) Indirect communication message transmission method, system, and gateway device
CN112637151B (en) Data message transmission method, terminal device, server and storage medium
CN112995095B (en) Data processing method, device and computer readable storage medium
CN109688204B (en) File downloading method, node and terminal based on NDN (named data networking)
US20200065508A1 (en) Device and method to share image received from user terminal with other user terminals
WO2024026802A1 (en) Data reporting method and apparatus, chip, storage medium, and computer program
WO2022213903A1 (en) Method and apparatus for processing information of edge configuration server, and communication device
WO2021121628A1 (en) Dynamic distribution of a computational graph
CN116366735A (en) Data transmission method and device, electronic equipment and readable storage medium
CN116471275A (en) Information transmission method, device, electronic equipment and readable 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