Request response method, device, electronic device and storage medium

By intercepting requests through annotation processing tools and the AOP of the Spring framework, and matching the total switch value with the address and object identification field values, the problem of low efficiency in determining the target program switch is solved, and efficient switch value management and flexible program switch determination are achieved.

CN116701474BActive Publication Date: 2025-09-30INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310566492.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-18
Publication Date
2025-09-30
Estimated Expiration
2043-05-18

AI Technical Summary

Technical Problem

The efficiency of determining the target program switch in the existing technology is low, and the management of program switches is relatively complicated. In particular, there are problems such as complexity in service upgrades and switch value management, and it is difficult to quickly troubleshoot production problems.

Method used

By using annotation processing tools to query the switch value according to the requested annotation information, the target program switch is matched with the total switch value and the address identification field value, and multi-level matching is performed in combination with the address and object identification field values ​​to avoid directly searching for the program switch of the target address from the database. The AOP in the Spring framework is used to intercept the request to obtain the annotation information.

Benefits of technology

The efficiency of determining the target program switch is improved, the switch value management is simplified, the pressure on the database server is reduced, redundant code and intrusive coding are reduced, and the flexibility and efficiency of determining the target program switch are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116701474B_ABST
    Figure CN116701474B_ABST
Patent Text Reader

Abstract

The present disclosure provides a request response method, device, electronic device, and storage medium, which can be applied to the fields of computer technology and financial technology. The method includes: in response to receiving a request, using an annotation processing tool to query and obtain a switch value corresponding to the annotation information based on the annotation information of the request, the annotation information being used to determine the target program switch called by the request, the switch value including a main switch value and a program switch value, the program switch value including an address identification field value, the address identification field value being used to determine the calling address of the target program switch; when the main switch value indicates that the main switch is turned on, determining multiple to-be-determined program switches corresponding to the main switch based on the main switch value; matching the address identification field value with the to-be-determined address identification field values ​​of the multiple to-be-determined program switches, and determining the target program switch from the multiple to-be-determined program switches, wherein the address identification field value matches the address identification field value of the target program switch.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the fields of computer technology and financial technology, and in particular to a request response method, device, electronic device, medium, and program product. Background Art

[0002] When calling a service, it is necessary to call a program to invoke the service. There can be a one-to-one correspondence between programs and program switches, meaning that the corresponding program can be called by changing the state of a single program switch. To manage program switches, a switch value corresponding to a switch field can be retrieved from a database storing switch values, and then the corresponding program switch can be called using this switch value.

[0003] In the process of realizing the inventive concept of the present disclosure, the inventors discovered that the related art has a problem of low efficiency in determining target program switches. Summary of the Invention

[0004] In view of the above problems, the present disclosure provides a request response method, apparatus, electronic device, medium, and program product.

[0005] According to a first aspect of the present disclosure, a request response method is provided, comprising: in response to receiving a request, querying and obtaining a switch value corresponding to the annotation information using an annotation processing tool based on annotation information of the request, wherein the annotation information is used to determine a target program switch called by the request, the switch value includes a main switch value and a program switch value, the program switch value includes an address identification field value, and the address identification field value is used to determine a calling address of the target program switch; when the main switch value indicates that the main switch is turned on, determining a plurality of to-be-determined program switches corresponding to the main switch based on the main switch value; matching the address identification field value with the to-be-determined address identification field values ​​of the plurality of to-be-determined program switches, and determining a target program switch from the plurality of to-be-determined program switches, wherein the address identification field value matches the address identification field value of the target program switch.

[0006] According to an embodiment of the present disclosure, the switch value also includes a first custom switch value, and the first custom switch value is used to determine whether the request calls a program switch that is prohibited from calling; when the main switch value indicates that the main switch is turned on, before determining multiple to-be-determined program switches corresponding to the main switch based on the main switch value, the above-mentioned request response method also includes: determining at least one disabled switch value corresponding to the main switch based on the main switch value; and performing a processing operation on the request when there is a disabled switch value that matches the first custom switch value among the at least one disabled switch value.

[0007] According to an embodiment of the present disclosure, the switch value also includes a second custom switch value, which is used to determine whether the request calls a program switch with calling permission; the above-mentioned request response method also includes: in the case that there is no switch value matching the first custom switch value in at least one disabled switch value, determining at least one calling permission switch value corresponding to the main switch according to the main switch value; in the case that there is a calling permission switch value matching the second custom switch value in at least one calling permission switch value, determining that the request has calling permission.

[0008] According to an embodiment of the present disclosure, the program switch value further includes an object identification field value; matching the address identification switch value with the to-be-determined address identification field values ​​of a plurality of to-be-determined program switches, and determining a target program switch from the plurality of to-be-determined program switches, includes: matching the address identification field value with the plurality of to-be-determined address identification field values, and determining a target address identification field value from the plurality of to-be-determined address identification field values, wherein the target address identification field value matches the address identification field value; matching the object identification field value with the to-be-determined object identification field values ​​of the plurality of to-be-determined program switches, and determining a target object identification field value from the plurality of to-be-determined object identification field values, wherein the plurality of to-be-determined object identification field values ​​correspond to the plurality of to-be-determined program switches, and the target object identification field value matches the object identification field value; and determining the target program switch from the plurality of to-be-determined program switches based on the target address identification field value and the target object identification field value.

[0009] According to an embodiment of the present disclosure, there are multiple address identification field values, and the multiple address identification field values ​​include I address identification field values ​​of different levels, where I is a positive integer; matching the address identification field value with multiple address identification field values ​​to be determined, and determining the target address identification field value from the multiple address identification field values ​​to be determined, including: matching the address identification field value of the i-th level with the multiple address identification field values ​​to be determined of the i-th level, and determining the target address identification field value of the i-th level from the multiple address identification field values ​​to be determined of the i-th level. value, wherein the target address identification field value of the i-th level matches the address identification field value of the i-th level, and the target address identification field value of the i-th level corresponds to multiple address identification field values ​​to be determined at the i+1-th level, wherein i is a positive integer less than 1; matching the address identification field value of the i-th level with multiple address identification field values ​​to be determined at the i-th level, and determining the target address identification field value from the multiple address identification field values ​​to be determined at the i-th level, wherein the target address identification field value matches the address identification field value of the i-th level.

[0010] According to an embodiment of the present disclosure, an annotation processing tool is used to query and obtain the switch value corresponding to the annotation information based on the requested annotation information, including: parsing the annotation information to obtain multiple switch fields; based on the multiple switch fields, querying and obtaining the switch value corresponding to each of the multiple switch fields.

[0011] According to an embodiment of the present disclosure, the above-mentioned request response method also includes: performing hash sorting on multiple switch fields according to the switch values ​​corresponding to each of the multiple switch fields to obtain a sorting result; and processing the switch values ​​corresponding to each of the multiple switch fields according to the sorting result.

[0012] According to an embodiment of the present disclosure, the request is a switch state change request, and the switch value also includes a state change switch value, which is used to change the on state or off state of the target program switch; the above-mentioned request response method also includes: changing the state of the target program switch according to the state change switch value to obtain the changed target program switch.

[0013] According to an embodiment of the present disclosure, the request response method further includes: if the program switch to be determined includes a full switch value and the full switch value representation matches, determining the program switch to be determined as a target program switch.

[0014] According to an embodiment of the present disclosure, the request response method further includes: when the annotation information further includes switch processing period information, processing the switch value according to the switch processing period information.

[0015] A second aspect of the present disclosure provides a request response device, comprising: a query module, configured to, in response to receiving a request, query and obtain a switch value corresponding to the annotation information based on the annotation information of the request using an annotation processing tool, wherein the annotation information is used to determine a target program switch called by the request, the switch value including a main switch value and a program switch value, the program switch value including an address identification field value, and the address identification field value being used to determine a calling address of the target program switch; a first determination module, configured to determine, when the main switch value indicates that the main switch is turned on, a plurality of to-be-determined program switches corresponding to the main switch based on the main switch value; and a second determination module, configured to match the address identification field value with the to-be-determined address identification field values ​​of the plurality of to-be-determined program switches, and determine a target program switch from the plurality of to-be-determined program switches, wherein the address identification field value matches the address identification field value of the target program switch.

[0016] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above method.

[0017] A fourth aspect of the present disclosure further provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the above method.

[0018] The fifth aspect of the present disclosure further provides a computer program product, comprising a computer program, which implements the above method when executed by a processor.

[0019] According to the request response method, device, electronic device, medium and program product provided by the present disclosure, when a request is received, the switch value is obtained by processing the annotation information using an annotation processing tool, thereby improving the efficiency of obtaining the switch value, and when the main switch is turned on, the target program switch of the target address corresponding to the address identification field value can be determined by matching in the program switch corresponding to the main switch, thereby avoiding the need to directly search for the program switch of the target address from a database with complex data, thereby improving the efficiency of determining the target program switch. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0021] Figure 1 Schematically shows an application scenario diagram of the request response method according to an embodiment of the present disclosure;

[0022] Figure 2 The following schematically shows a flow chart of a request response method according to an embodiment of the present disclosure;

[0023] Figure 3 A schematic diagram schematically illustrates a method for matching address identification field values ​​according to an embodiment of the present disclosure;

[0024] Figure 4 A schematic diagram schematically illustrates a target program switch determination method according to an embodiment of the present disclosure;

[0025] Figure 5 A schematic diagram schematically illustrates a method for storing sorting results according to an embodiment of the present disclosure;

[0026] Figure 6 A schematic diagram schematically illustrates a target program switch calling method according to an embodiment of the present disclosure;

[0027] Figure 7 Schematically shows a structural block diagram of a request response device according to an embodiment of the present disclosure; and

[0028] Figure 8 A block diagram of an electronic device suitable for implementing the request response method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0029] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the detailed description below, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0030] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise," "include," etc. used herein indicate the presence of the features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0031] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0032] When expressions such as "at least one of A, B and C, etc." are used, they should generally be interpreted in accordance with the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0033] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision, disclosure and application of the data involved (including but not limited to user personal information) comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good morals.

[0034] According to embodiments of the present disclosure, when calling a service, it is necessary to call a program to implement the service call. There can be a one-to-one correspondence between programs and program switches, meaning that a single program corresponding to that program switch can be called by changing the state of a single program switch. Managing program switches can be accomplished by querying a database storing switch values ​​based on a switch field, obtaining the switch value corresponding to that switch field, and then using that switch value to call the program switch corresponding to that switch value.

[0035] In the case of a service upgrade, the new and old services can coexist, and the switch field can be used to implement the change between the new and old services, thereby reducing the risks associated with the service upgrade. For example, if there is a problem with the new service upgrade, the switch field can be used to change the on / off status of the program switches related to the new and old services, switching the service back to the old service to ensure normal service provision. However, since controlling the program switch through a single dimension is only a single-dimensional control, that is, one switch field controls one program switch. Therefore, when the program switch needs to be set according to the service dimension or function dimension, there is a problem that the program switch setting is relatively complex and difficult to manage. Among them, setting the program switch according to the service dimension can be, but is not limited to, searching for the program switch corresponding to a specific service from a database and setting the program switch. Setting the program switch according to the function dimension can be, but is not limited to, searching for the program switch corresponding to a specific function from a database and setting the program switch.

[0036] Furthermore, in the switch design method, switches are used to modify new and existing services. This typically involves querying a database based on the switch field used by the service to obtain the corresponding switch value. This value is then used to change the on / off state of the program switch corresponding to the service. Furthermore, during service operation, a query based on the switch field is required before each service is provided to determine whether to provide the service. If a switch value needs to be modified, the switch value stored in the switch field in the database must be updated for it to take effect, or the code and database must be modified simultaneously.

[0037] However, due to the high degree of coupling between the switch field and the switch value, and the high degree of intrusion of the switch call method into the service's business code, modifying the switch field or switch value requires modifying the code corresponding to the switch field or switch value. Since the control methods for adding, deleting, checking, and modifying switch values ​​are difficult to meet the requirements, it is difficult to troubleshoot program switches based on the switch value in the event of a production problem to determine the program switch that corresponds to the production problem. For this reason, when there are many services, the management of switch values ​​becomes more complicated.

[0038] Based on the above content, the inventors found that since the management of switch values ​​is relatively complicated, there is a problem of low efficiency in determining the switch of the target program.

[0039] In view of this, an embodiment of the present disclosure provides a request response method, comprising: in response to receiving a request, using an annotation processing tool to query and obtain a switch value corresponding to the annotation information based on the annotation information of the request, wherein the annotation information is used to determine the target program switch called by the request, the switch value includes a main switch value and a program switch value, the program switch value includes an address identification field value, and the address identification field value is used to determine the calling address of the target program switch. In the case where the main switch value represents that the main switch is turned on, multiple to-be-determined program switches corresponding to the main switch are determined based on the main switch value. The address identification field value is matched with the to-be-determined address identification field values ​​of the multiple to-be-determined program switches, and the target program switch is determined from the multiple to-be-determined program switches, wherein the address identification field value matches the address identification field value of the target program switch.

[0040] Figure 1 The application scenario diagram of the request response according to the embodiment of the present disclosure is schematically shown.

[0041] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links or optical fiber cables.

[0042] The user may use at least one of the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0043] The first terminal device 101 , the second terminal device 102 , and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0044] The server 105 may be a server that provides various services, such as a background management server (for example only) that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process received user requests and other data, and feed back processing results (e.g., web pages, information, or data obtained or generated according to user requests) to the terminal devices.

[0045] It should be noted that the request response method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the request response device provided in the embodiment of the present disclosure can generally be set in the server 105. The request response method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the request response device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.

[0046] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.

[0047] The following will be based on Figure 1 The scene described by Figures 2 to 6 The request response method of the disclosed embodiment is described in detail.

[0048] Figure 2 The flowchart of the request response method according to an embodiment of the present disclosure is schematically shown.

[0049] like Figure 2 As shown, the request response method of this embodiment includes operations S210 to S230.

[0050] In operation S210, in response to receiving the request, the annotation processing tool is used to query the switch value corresponding to the annotation information based on the annotation information of the request, wherein the annotation information is used to determine the target program switch called by the request, the switch value includes the total switch value and the program switch value, the program switch value includes the address identification field value, and the address identification field value is used to determine the calling address of the target program switch.

[0051] According to embodiments of the present disclosure, requests may include query requests, switch state change requests, and switch update requests. For example, a query request may be used to query and identify a program switch, but is not limited to this; a switch state change request may be used to change the switch state of a program switch, thereby enabling configuration of the program switch, but is not limited to this; and a switch update request may be used to update the switch value corresponding to a program switch, but is not limited to this. Each of the above query requests, switch state change requests, and switch update requests may require the identification of a target program switch.

[0052] According to an embodiment of the present disclosure, a request may include annotation information. The annotation information may include a switch field corresponding to the service identification field and the method identification field, or a switch value corresponding to the service identification field and the method identification field. The service identification field may be used to identify the service invoked by the request, and the method identification field may be used to identify the method used by the request to invoke the service.

[0053] Switch values ​​can include a master switch value and a program switch value. The master switch value can be used to determine the master switch for the scenario corresponding to the target program switch. For example, in a transaction scenario, the master switch value can be used to determine the program switch corresponding to the program executing the transaction, but is not limited to this. The program switch value can also be used to determine the target program switch. For example, if there are program switches corresponding to multiple programs, the target program switch can be determined from the program switches corresponding to the multiple programs based on the program switch value.

[0054] According to an embodiment of the present disclosure, an annotation processing tool can be used to parse annotation information to obtain a switch value. The annotation processing tool can also be used to parse annotation information to obtain a switch field, and then query the database based on the switch field to obtain the switch value corresponding to the switch field. The annotation processing tool can be an Apollo component designed based on a distributed microservice architecture. When the annotation processing tool is used to process annotation information and multiple switch values ​​are obtained, it is possible to avoid repeatedly querying multiple switch values ​​corresponding to the multiple switch fields based on the multiple switch fields. As a result, the input and output data of the database server can be reduced, the pressure on the database server can be reduced, and the efficiency of obtaining the switch value can be improved.

[0055] According to an embodiment of the present disclosure, the address identification field value may include a region identification field value and a network point identification field value. The region identification field value may be used to determine the region where the target program switch is called, and the network point identification field value may be used to determine the network point where the target program switch is called. The calling address may be the target address for calling the target program switch. For example, when only the program switch at the target address is called, the program switch corresponding to the target address may be determined based on the address identification field value, but the present invention is not limited thereto.

[0056] According to embodiments of the present disclosure, annotation information can be defined and then applied to a method that calls a program. Thus, a program switch can be determined based on the annotation information, and the program corresponding to the program switch can be called according to the calling method. Aspect-oriented programming (AOP) in the Spring framework, an open source framework based on a layered architecture, can be used to intercept requests and obtain the requested annotation information.

[0057] According to embodiments of the present disclosure, when a target program switch is called, the program switch corresponding to the target address can be determined based on the value of the address identification field. For example, if the value of the address identification field represents area A, the target program switch corresponding to area A can be determined. This allows only the switch state of the target program switch corresponding to the target area to be changed.

[0058] In operation S220 , when the main switch value indicates that the main switch is on, a plurality of to-be-determined program switches corresponding to the main switch are determined according to the main switch value.

[0059] According to an embodiment of the present disclosure, the main switch value may include a main switch status value corresponding to the switch status of the main switch and a main switch identification field value. The main switch status value can be used to determine the switch status of the main switch, and the main switch identification field value can be used to determine multiple program switches to be determined corresponding to the main switch identification field value.

[0060] According to an embodiment of the present disclosure, the program switch to be determined may be the program switch to be determined as the target program switch. The multiple program switches to be determined corresponding to the master switch may be program switches to be determined that are stored in association with the master switch. The program switches to be determined that are stored in association with the master switch may be stored by associating the master switch identification field value with the program switch identification field value of the program switch to be determined, or by associating the master switch value of the master switch with the switch value of the program switch to be determined.

[0061] According to an embodiment of the present disclosure, the main switch value can be matched with the switch value of the main switch to be determined to determine a target main switch whose switch value matches the main switch value; then, based on the target main switch, multiple program switches to be determined corresponding to the target main switch can be determined.

[0062] Among them, according to the target main switch, multiple to-be-determined program switches corresponding to the target main switch are determined. This can be done by querying the main switch identification field value of the target main switch to obtain the program switch identification field values ​​of the multiple to-be-determined program switches stored in association with the main switch identification field value; or it can be done by querying the main switch value of the target main switch to obtain the switch values ​​of the multiple to-be-determined program switches stored in association with the main switch value.

[0063] According to embodiments of the present disclosure, individual services can be divided according to product dimensions to create product lines. For example, services such as balance inquiry, amount transfer, and fund change reminders can all be classified into the transfer processing product line, and the master switch for that product line can be set based on the transfer processing product line. Thus, when a request is made to determine the program switch for the transfer processing product line, the master switch for the transfer processing product line can be used to determine the program switch stored and associated with the master switch. This program switch can then be called.

[0064] In operation S230, the address identification field value is matched with the address identification field values ​​of the plurality of pending program switches to determine a target program switch from the plurality of pending program switches, wherein the address identification field value matches the address identification field value of the target program switch.

[0065] According to an embodiment of the present disclosure, the switch value of the to-be-determined program switch may include a to-be-determined address identification field value. The to-be-determined address identification field value may be used to determine a target program switch corresponding to the address identification field value.

[0066] According to an embodiment of the present disclosure, by matching the address identification field value with the address identification field values ​​to be determined of multiple program switches to be determined, the target program switch corresponding to the address represented by the address identification field value can be determined. For example: the call address represented by the address identification field value can be area B, and thus, the determined target program switch can also correspond to the program switch in area B. Based on this, the target program switch of the target area can be determined. In the case where the request is a query request, the target program switch in area B can be queried and determined. In the case where the request is a switch state change request, the switch state of the target program switch in area B can be changed in a targeted manner. In the case where the request is a switch state change request, the switch state of the target program switch in area B can be changed in a targeted manner. In the case where the request is a switch update request, the target program switch in area B can be updated in a targeted manner.

[0067] According to an embodiment of the present disclosure, when a request is received, the switch value is obtained by processing the annotation information using an annotation processing tool, thereby improving the efficiency of obtaining the switch value, and when the main switch is turned on, the target program switch of the target address corresponding to the address identification field value can be determined by matching in the program switch corresponding to the main switch, thereby avoiding the need to directly search for the program switch of the target address from a database with complex data, thereby improving the efficiency of determining the target program switch.

[0068] According to an embodiment of the present disclosure, the program switch value may further include a category identification field value, wherein the category identification field may be used to determine the category of the service.

[0069] The target program switch corresponding to the target program belonging to the target category and used to execute the target method can be determined from the target program switches corresponding to the target address according to the category identification field value and the method identification field value.

[0070] In the case where the annotation information includes a category identification field and a method identification field, the category identification field value and the method identification field value can be dynamically obtained based on the category identification field and the method identification field, which simplifies the process and helps to quickly determine the target program switch corresponding to the category identification field and the method identification field. In addition, since the annotation information is used to determine the target program switch, the redundant calling code and intrusive coding between the switch field and the switch value, as well as the redundant calling code and intrusive coding between the switch value and the program switch can be avoided. Among them, the intrusive coding can represent the coupling relationship between the switch field and the switch value due to coding, as well as the coupling relationship between the switch value and the program switch due to coding.

[0071] According to an embodiment of the present disclosure, the program switch value also includes an object identification field value; matching the address identification switch value with the to-be-determined address identification field values ​​of multiple to-be-determined program switches, and determining a target program switch from the multiple to-be-determined program switches, includes: matching the address identification field value with the multiple to-be-determined address identification field values, determining a target address identification field value from the multiple to-be-determined address identification field values, wherein the target address identification field value matches the address identification field value; matching the object identification field value with the multiple to-be-determined object identification field values, and determining a target object identification field value from the multiple to-be-determined object identification field values, wherein the multiple to-be-determined object identification field values ​​correspond to the multiple to-be-determined program switches, and the target object identification field value matches the object identification field value. The target program switch is determined from the multiple to-be-determined program switches based on the target address identification field value and the target object identification field value.

[0072] According to an embodiment of the present disclosure, the object identification field value can be a field value used to determine the target object, and the object identification field value can be used to control the program switch corresponding to the target object. The target object can be the object for which the service is requested to be provided, but is not limited thereto. The target object can also be the object for which the service provided is requested to be canceled. The object identification field value can be obtained by processing the annotation information using an annotation processing tool. For example: the annotation information is parsed using an annotation processing tool to obtain the object identification field, and then the object identification field value is obtained by querying based on the object identification field.

[0073] According to an embodiment of the present disclosure, the switch value of the target program switch to be determined may include the address identification field value to be determined and the object identification field value to be determined. The target program switch may be a program switch having a target address identification field value and a target object identification field value. For example, the main switch B may correspond to the program switch to be determined B1, the program switch to be determined B2, and the program switch to be determined B3. The switch value of the program switch to be determined B1 may only include the target object identification field value that matches the object identification field value; the switch value of the program switch to be determined B2 may only include the target address identification field value that matches the address identification field value; the switch value of the program switch to be determined B3 may include the target object identification field value that matches the object identification field value, and the target address identification field value that matches the address identification field value. Thus, the program switch to be determined B3 can be determined as the target program switch. Based on this, the target program switch can be determined by matching the address identification field value and the object identification field value respectively.

[0074] According to an embodiment of the present disclosure, matching the address identification field value with the to-be-determined address identification field value may involve determining, from the to-be-determined address identification field value, a field value identical to the address identification field value, but is not limited thereto. The to-be-determined address identification field value identical to the address identification field value may be determined as the target address identification field value that matches the address identification field value.

[0075] According to an embodiment of the present disclosure, matching an object identification field value with the object identification field values ​​of a plurality of program switches to be determined may involve determining, but is not limited to, a field value identical to the object identification field value from the object identification field values ​​to be determined. The object identification field value to be determined that is identical to the object identification field value may be determined as a target object identification field value that matches the object identification field value.

[0076] According to an embodiment of the present disclosure, the address identification field value and the to-be-determined address identification field value can be matched to determine the to-be-determined program switch containing the target address identification field value; then, among the to-be-determined program switches containing the target address identification field value, the target program switch containing the target object identification field value is determined.

[0077] According to an embodiment of the present disclosure, the object identification field value and the to-be-determined object identification field value may also be matched to determine the to-be-determined program switch containing the target object identification field value; and then, among the to-be-determined program switches containing the target object identification field value, the target program switch containing the target address identification field value may be determined.

[0078] According to an embodiment of the present disclosure, the target program switch corresponding to the address identification field value and the object identification field value is determined by matching the address identification field value and the object identification field value respectively. Thus, the corresponding target program switch can be determined specifically for the target address corresponding to the address identification field value and the target object corresponding to the object identification field value, thereby improving the flexibility of determining the target program switch.

[0079] According to an embodiment of the present disclosure, there are multiple address identification field values, and the multiple address identification field values ​​include I address identification field values ​​of different levels, where I is a positive integer; matching the address identification field value with multiple address identification field values ​​to be determined, and determining the target address identification field value from the multiple address identification field values ​​to be determined, including: matching the address identification field value of the i-th level with multiple address identification field values ​​to be determined of the i-th level, and determining the target address identification field value of the i-th level from the multiple address identification field values ​​to be determined of the i-th level, where the target address identification field value of the i-th level matches the address identification field value of the i-th level, and the target address identification field value of the i-th level corresponds to multiple address identification field values ​​to be determined of the i+1-th level, where i is a positive integer less than I. Match the address identification field value of the first level with multiple address identification field values ​​to be determined of the first level, and determine the target address identification field value from the multiple address identification field values ​​to be determined of the first level, wherein the target address identification field value matches the address identification field value of the first level.

[0080] According to an embodiment of the present disclosure, address identification field values ​​at different levels may be address identification field values ​​at different levels having an inclusion relationship. For example, based on District D11 of City D1 in Province D, three address identification field values ​​at different levels may be obtained. The first-level address identification field value corresponds to Province D, the second-level address identification field value may correspond to City D1 in Province D, and the third-level address identification field value may correspond to District D11 of City D1 in Province D, but is not limited thereto.

[0081] According to an embodiment of the present disclosure, address identification field values ​​at different levels may be matched with the address identification field value to be determined in sequence according to the levels.

[0082] For example: the address identification field value corresponding to Province D can be matched with the address identification field values ​​to be determined at multiple provincial levels, so as to determine the address identification field value corresponding to Province D from the address identification field values ​​to be determined at multiple provincial levels, and then the target program switch to be determined corresponding to Province D can be determined.

[0083] The address identification field value corresponding to City D1 in Province D can be matched with the target program switch to be determined at the city level corresponding to Province D, thereby determining the address identification field value corresponding to City D1 in Province D from multiple address identification field values ​​to be determined at the city level, and further determining the target program switch to be determined corresponding to City D1 in Province D;

[0084] The address identification field value corresponding to District D11 of City D1 in Province D can be matched with the target program switch at the district level corresponding to City D1 in Province D. In this way, the address identification field value corresponding to District D11 of City D1 in Province D can be determined from the address identification field values ​​at multiple district levels to be determined. Then, the target program switch corresponding to District D11 of City D1 in Province D can be determined. Thus, the target program switch of the target area can be determined.

[0085] According to an embodiment of the present disclosure, the target address identification field value is determined hierarchically through address identifications at different levels, thereby achieving flexibility in determining the target address identification field value, thereby improving the flexibility in determining the target program switch.

[0086] According to an embodiment of the present disclosure, the request response method further includes: if the program switch to be determined includes a full switch value and the full switch value representation matches, determining the program switch to be determined as a target program switch.

[0087] According to an embodiment of the present disclosure, a full switch value may include a first full switch value and a second full switch value. The first full switch value is used to determine that the program switch to be determined is a program switch that cannot be called by any request, and the first full switch value may indicate that the switch value of the program switch to be determined does not match the program switch value. The second full switch value may be used to determine that the program switch to be determined is a program switch that can be called by all requests, and the second full switch value may indicate that the switch value of the program switch to be determined matches the program switch value.

[0088] In the case where the switch value of the program switch to be determined includes the first full switch value, even if the program switch value obtained according to the request matches the switch value of the program switch to be determined, the program switch value is not determined as the target program switch; in the case where the switch value of the program switch to be determined includes the second full switch value, the program switch to be determined can be directly determined as the target program switch.

[0089] For undeveloped program switches, the first full switch value can be set in the switch value. Therefore, even if a request requires calling the program switch, the program switch is not determined as the target program switch, saving the operation of determining the target program switch through matching and improving the efficiency of processing requests.

[0090] For program switches that need to be called by some basic services, a second full switch value can be set in the switch value of the program switch to be determined. When a request is received, the target program call switch including the second full switch value is directly determined from the program switch, saving the operation of determining the target program switch through matching and improving the efficiency of determining the target program call switch, but is not limited to this.

[0091] According to an embodiment of the present disclosure, when the program switch to be determined includes a full switch value and the full switch value representation matches, the program switch to be determined is directly determined as the target program switch. This avoids the program switch value matching process and improves the efficiency of determining the target program switch.

[0092] According to an embodiment of the present disclosure, the first full switch value may be NONE, and the second full switch value may be ALL. The NONE value may indicate a mismatch, and the ALL value may indicate a match. If the switch value of the program switch to be determined only includes the ALL value, the program switch to be determined may be directly determined as the target program switch. If the switch value of the program switch to be determined only includes the NONE value, it may be determined that the program switch to be determined does not match any program switch value.

[0093] According to an embodiment of the present disclosure, a binary search method can be used to assign ALL values ​​to delimiters one by one for matching.

[0094] For example, the delimiter can be "_". Therefore, the format of the switch value obtained from the annotation information can include "first-level address identifier field value_second-level address identifier field value_object identifier field value". During the matching process for identifiers at different levels, the last character of the delimiter can be replaced with the ALL value for matching.

[0095] For example: "first-level address identification field value_second-level address identification field value_object identification field value" can be adjusted to "first-level address identification field value_ALL", thereby matching "first-level address identification field value_ALL" with the first-level address identification field value to be determined; "first-level address identification field value_second-level address identification field value_object identification field value" can be adjusted to "first-level address identification field value_second-level address identification field value_ALL", thereby matching "first-level address identification field value_second-level address identification field value_ALL" with the second-level address identification field value to be determined corresponding to the first-level address identification field value to be determined; "first-level address identification field value_second-level address identification field value_object identification field value" can be matched with the object identification field value to be determined corresponding to the above-mentioned second-level address identification field value to be determined, thereby determining the target program switch.

[0096] This method can be used to set program switches for target addresses and target objects. In the case where the service is piloted for the target object of the target address, the above method can be used to set the program switch accordingly. For example, in the case of gradually expanding the scope of service use in the future, the address identification field value can be set to "first-level address identification field value_ALL", that is, only the first-level address identification field value is retained. Thus, the outlets and target objects at the first-level address corresponding to the address identification field value of the first level can use the service, but it is not limited to this. The address identification field values ​​of multiple levels can be adaptively retained to match the address identification field value of the retained level, so as to match according to the address identification field value of the retained level. Based on this, this method can meet multi-dimensional control needs.

[0097] According to an embodiment of the present disclosure, in the case where the program switch value does not include the address identification field value, it can be determined that the program switch value does not match the to-be-determined address identification field values ​​of all the to-be-determined program switches. In the case where the program switch value does not include the object identification field value, it can be determined that the program switch value does not match the to-be-determined object identification field values ​​of all the to-be-determined program switches. In the case where the switch value of the to-be-determined program switch does not include the to-be-determined address identification field value, it can be determined that the switch value of the to-be-determined program switch does not match the address of the program switch value including the address identification field value. In the case where the switch value of the to-be-determined program switch does not include the to-be-determined object identification field value, it can be determined that the target object of the to-be-determined program switch does not match the target object of the program switch value including the object identification field value.

[0098] Figure 3 A schematic diagram of an address identification field value matching method according to an embodiment of the present disclosure is schematically shown.

[0099] like Figure 3 As shown, the request response method of this embodiment includes operations S301 to S307.

[0100] In operation S301, an address identification field value and an address identification field value to be determined are obtained, wherein the address identification field value includes a first-level address identification field value and a second-level address identification field value, and the address identification field value to be determined includes a first-level address identification field value to be determined and a second-level address identification field value to be determined.

[0101] In operation S302, is it determined whether the address identification field value includes the first full switch value? If yes, then operation S307 is executed; if no, then operation S303 is executed.

[0102] In operation S303 , is it determined whether the address identification field value includes the second full switch value? If yes, operation S306 is executed; if not, operation S304 is executed.

[0103] In operation S304, does the to-be-determined address identification field value of the first level include the address identification field value of the first level? If yes, then operation S305 is executed; if no, then operation S307 is executed.

[0104] In operation S305, does the to-be-determined address identification field value of the second level include the address identification field value of the second level? If yes, then operation S306 is executed; if not, then operation S307 is executed.

[0105] In operation S306 , it is determined that the address identification field value matches the address identification field value to be determined.

[0106] In operation S307 , it is determined that the address identification field value does not match the to-be-determined address identification field value.

[0107] According to an embodiment of the present disclosure, the switch value also includes a first custom switch value, which is used to determine whether the request invokes a prohibited program switch. If the master switch value indicates that the master switch is on, before determining multiple pending program switches corresponding to the master switch based on the master switch value, the request response method further includes determining at least one disabled switch value corresponding to the master switch based on the master switch value. If one of the at least one disabled switch values ​​matches the first custom switch value, processing the request is performed.

[0108] According to an embodiment of the present disclosure, the first custom switch value may be obtained by processing annotation information using an annotation processing tool. For example, the annotation processing tool may be used to parse the annotation information to obtain the first custom switch field, and then the first custom switch value may be obtained by querying the first custom switch field.

[0109] According to an embodiment of the present disclosure, the disable switch value may be a switch value corresponding to a program switch that prohibits calling. The disable switch value that matches the first custom switch value may be the same switch value as the first custom switch value, but is not limited thereto.

[0110] According to an embodiment of the present disclosure, the at least one disabling switch value corresponding to the main switch may be at least one disabling switch value stored in association with the main switch value, but is not limited thereto.

[0111] According to an embodiment of the present disclosure, at least one disable switch value corresponding to the main switch is determined based on the main switch value. For example, the main switches may include an X switch, a Y switch, and a Z switch. If the main switch corresponding to the main switch value is the X switch, the disable switch values ​​1100, 1110, and 1111 stored in association with the main switch X may be obtained.

[0112] According to an embodiment of the present disclosure, the first custom switch value and the disable switch value can be matched to determine whether the request prohibits the invocation of the prohibited program switch. For example, the first custom switch value can be 1100, which is the same as the disable switch value 1100, thereby determining that the request invokes the prohibited program switch.

[0113] If there is a disable switch value matching the first custom switch value among at least one disable switch value, it can be determined that the program switch called by the above request is a program switch that is prohibited from being called. Based on this, a processing operation can be performed on the above request, and the processing operation may include a blocking operation.

[0114] According to an embodiment of the present disclosure, by matching the first custom switch value with at least one disabled switch value corresponding to the main switch, it is possible to determine through matching whether the program switch determined by the request includes a program switch that is prohibited from being called, thereby avoiding requesting to call a program switch that is prohibited from being called.

[0115] According to an embodiment of the present disclosure, the first custom switch value may also include an address identification field value, an object identification field value, a category identification field value, and a method identification field value. Based on this, the first custom switch value and the disable switch value are matched to determine whether the above request prohibits calling the program switch that is prohibited from calling. The address identification field value, object identification field value, category identification field value, and method identification field value included in the first custom switch value can be matched with the address identification field value, object identification field value, category identification field value, and method identification field value included in the disable switch value according to the above method. If there is a disable switch value in the above at least one disable switch value that matches the address identification field value, object identification field value, category identification field value, and method identification field value included in the first custom switch value, it can be determined that the program switch determined by the request includes a program switch that prohibits calling. The matching method of the address identification field value, object identification field value, category identification field value, and method identification field value is as described above and will not be repeated here.

[0116] According to an embodiment of the present disclosure, the switch value also includes a second custom switch value, which is used to determine whether the request calls a program switch with call permission. The above-mentioned request response method also includes: if there is no switch value matching the first custom switch value in at least one disabled switch value, determining at least one call permission switch value corresponding to the main switch based on the main switch value. If there is a call permission switch value matching the second custom switch value in at least one call permission switch value, it is determined that the request has call permission.

[0117] According to an embodiment of the present disclosure, the second custom switch value may be obtained by processing the annotation information using an annotation processing tool. For example, the annotation information is parsed using the annotation processing tool to obtain the second custom switch field, and then the second custom switch value is obtained by querying the second custom switch field.

[0118] According to an embodiment of the present disclosure, a program switch with call permission may be a program switch that allows the above-mentioned request to call. The call permission switch value may have a switch value corresponding to the call permission switch. The call permission switch value that matches the first custom switch value may be the same switch value as the second custom switch value, but is not limited thereto.

[0119] According to an embodiment of the present disclosure, the at least one calling permission switch value corresponding to the main switch may be a calling permission switch value stored in association with the main switch value, but is not limited thereto.

[0120] According to an embodiment of the present disclosure, at least one call permission switch value corresponding to the main switch is determined based on the main switch value. For example, the main switch may include an X switch, a Y switch, and a Z switch. When the main switch corresponding to the main switch value is the X switch, the disable switch values ​​1000, 1010, and 1011 stored in association with the main switch X may be obtained.

[0121] According to an embodiment of the present disclosure, the second custom switch value can be matched with the call permission switch value to determine whether the request calls a program switch with call permission. For example, the first custom switch value can be 1000, which is the same as the disable switch value 1000. Therefore, it can be determined that the request calls a program switch with call permission.

[0122] If there is a calling permission switch value matching the second custom switch value in the at least one calling permission switch value, it can be determined that the program switch called by the request is a program switch that is allowed to be called.

[0123] According to an embodiment of the present disclosure, by matching the second custom switch value with at least one calling permission switch value corresponding to the main switch, it is possible to determine through matching whether the program switch determined by the request calls a program switch with calling permission, thereby avoiding requesting to call a program switch that does not have calling permission.

[0124] According to an embodiment of the present disclosure, the second custom switch value may also include an address identification field value, an object identification field value, a category identification field value, and a method identification field value. Based on this, the second custom switch value is matched with the disable switch value to determine whether the above request calls a program switch with call permission. The address identification field value, object identification field value, category identification field value, and method identification field value included in the first custom switch value can be matched with the address identification field value, object identification field value, category identification field value, and method identification field value included in the call permission switch value according to the above method. In the case where there is a call permission switch value in the above at least one disable switch value that matches the address identification field value, object identification field value, category identification field value, and method identification field value included in the first custom switch value, it can be determined that the program switch determined by the request includes a program switch with call permission. The matching method for the address identification field value, object identification field value, category identification field value, and method identification field value is as described above and will not be repeated here.

[0125] According to an embodiment of the present disclosure, since the first custom switch value and the second custom switch value are matched, when the service corresponding to the request is more urgent and requires special processing, comprehensive control can be performed by disabling the switch value and calling the permission switch value.

[0126] According to an embodiment of the present disclosure, by using a first custom switch value and a second custom switch value, business issues that may arise when modifying the switch value of a master switch, the switch value of a program switch to be determined, or the like are avoided. Such business issues may include, but are not limited to, the problem of a program switch being incorrectly called due to a modification of the switch value of the program switch to be determined. By setting the first custom switch value, it is possible to determine whether the program switch being called by the request is temporarily prohibited from being called due to issues such as a modified switch value, thereby avoiding the problem of incorrectly calling the program switch. Furthermore, by setting the second custom switch value, it is possible to determine whether the program switch being called by the request has call permission, thereby avoiding the problem of incorrectly calling the program switch.

[0127] According to an embodiment of the present disclosure, the to-be-determined main switch value, the disabled switch value, the call permission switch value and the program switch value of the to-be-determined main switch can all be stored on a storage platform corresponding to the annotation processing tool.

[0128] According to embodiments of the present disclosure, target program switches can be determined in a multi-layered and multi-dimensional manner based on the master switch value, the first custom switch value, the second custom switch value, the address identification field value, and the object identification field value. Table 1 below schematically illustrates switches and switch fields, where "product / scenario" can be used to indicate the product line or business scenario corresponding to the master switch.

[0129] Table 1

[0130]

[0131] By defining the switch field corresponding to the main switch in the annotation information, and according to the main switch value corresponding to the main switch field, determining the disable switch value, call permission switch value and switch value of the program switch to be determined corresponding to the main switch. Then, the disable switch value, call permission switch value and switch value of the program switch to be determined are matched as described above. In the case where it is determined that one of the disable switch value, call permission switch value and switch value of the program switch to be determined does not match, the call can be made according to the preset service and method, which can improve the efficiency of calling the service and method, wherein the preset service and method can be obtained from the annotation information. For example, in the case of mismatch, the preset method can be called by the reflection call method. It can be based on the Bean instance of SpringUtility to call the preset method by the reflection call method. The Bean instance of SpringUtility can be a software component model instance of Java (i.e., an object-oriented programming language), and the reflection call method can be based on the category identification information to determine the attributes and call method of the category corresponding to the category identification information.

[0132] Figure 4The following is a schematic diagram schematically illustrating a target program switch determination method according to an embodiment of the present disclosure.

[0133] like Figure 4 As shown, the request response method of this embodiment includes operations S401 to S409.

[0134] In operation S401 , annotation information is processed using an annotation processing tool to obtain a total switch value, a first custom switch value, a second custom switch value, and a program switch value.

[0135] In operation S402 , is the main switch in the on state? If so, operation S409 is executed; if not, operation S403 is executed.

[0136] In operation S403 , at least one disable switch value corresponding to the main switch is determined according to the main switch value.

[0137] In operation S404 , is there a switch value matching the first custom switch value in the at least one disabled switch value? If yes, operation S409 is executed; if not, operation S405 is executed.

[0138] In operation S405, at least one calling permission switch value corresponding to the main switch is determined according to the main switch value.

[0139] In operation S406, does at least one calling permission switch value have a switch value that matches the second custom switch value? If yes, then operation S407 is executed; if not, then operation S409 is executed.

[0140] In operation S407 , it is determined whether the request has the calling authority.

[0141] In operation S408 , a target program switch is determined through matching from among a plurality of to-be-determined program switches corresponding to the main switch.

[0142] In operation S409 , a preset method is called through a reflection calling method.

[0143] According to an embodiment of the present disclosure, an annotation processing tool is used to query and obtain switch values ​​corresponding to the requested annotation information, including: parsing the annotation information to obtain multiple switch fields, and querying and obtaining switch values ​​corresponding to each of the multiple switch fields based on the multiple switch fields.

[0144] According to embodiments of the present disclosure, when parsing annotation information, multiple switch fields may be obtained. The multiple switch fields may be sorted according to the parsed time information to obtain a sorting result, but the present invention is not limited thereto. The sorting result is then used to sequentially query and obtain the switch values ​​corresponding to each of the multiple switch fields. Processing operations are then performed on the switch values ​​in sequence according to the sorting result to determine the target program switches corresponding to each of the multiple switch values.

[0145] According to an embodiment of the present disclosure, by utilizing an annotation processing tool to parse annotation information, multiple switch fields are obtained, and then based on the multiple switch fields, switch values ​​corresponding to each of the multiple switch fields are queried to obtain, thereby improving the efficiency of obtaining switch values.

[0146] According to an embodiment of the present disclosure, the request response method further includes: performing hash sorting on the multiple switch fields according to the switch values ​​corresponding to the multiple switch fields to obtain a sorting result, and processing the switch values ​​corresponding to the multiple switch fields according to the sorting result.

[0147] According to an embodiment of the present disclosure, hash values ​​corresponding to the plurality of switch fields may be determined based on the switch values ​​corresponding to the plurality of switch fields, and then the switch fields may be sorted according to the hash values ​​to obtain a sorting result.

[0148] According to an embodiment of the present disclosure, the storage space corresponding to the switch value can be calculated using the following formula (1):

[0149]

[0150] Among them, L can be the storage space corresponding to the switch value, values ​​can be the switch value, and Len(values) can be the data length of the switch value. For example, the data length of the switch value may be determined according to the field length of the switch field corresponding to the switch value, but is not limited thereto.

[0151] According to an embodiment of the present disclosure, the hash value can be calculated using the following formula (2):

[0152] H(value) = Dec(Bin(value)) %L (2)

[0153] Among them, Dec is decimal conversion and Bin is binary conversion.

[0154] According to an embodiment of the present disclosure, a hash collision resolution method is H(value)+k, where k is a positive integer less than L. Hash collisions can be resolved using k. For example, if two switch fields have the same hash value, the hash value corresponding to one of the switch fields can be added to k to resolve the difficulty of sorting when the hash values ​​corresponding to the two switch fields are the same.

[0155] According to the embodiment of the present disclosure, the time complexity of hash sorting can be the asymptotic time complexity of the hash algorithm. Under ideal conditions, the time complexity can be O(n), where the ideal condition is that the hash values ​​corresponding to all switch values ​​are different; under extreme conditions, the time complexity can be O(n 2 ), where the extreme case is that the hash values ​​corresponding to all switch values ​​are the same. 2 Both can represent the sum of execution times.

[0156] According to the embodiments of the present disclosure, since the switch value must be retrieved from the database based on the switch field, if a service calls a large number of program switches simultaneously, this can put pressure on the database. Therefore, when a service initiates a request to change the switch state of a program switch, the switch field can be hash-sorted, and the switch value processed according to the sorting result. This can alleviate database pressure and improve the efficiency of determining the target program switch.

[0157] For example, if the amount of data contained in multiple switch fields is inconsistent, the switch fields can be sorted based on the address identification field value and the object identification field value. This can allow the new service to be provided only to the target object at the target address, while other areas continue to use the old service. This can avoid excessive computer resource usage caused by determining the target program switch based on multiple switch values ​​simultaneously, thereby improving determination efficiency.

[0158] According to an embodiment of the present disclosure, multiple switch fields are hashed according to the switch values ​​corresponding to each of the multiple switch fields to obtain a sorting result, and then the switch values ​​corresponding to each of the multiple switch fields are processed according to the sorting result. In this way, the problem of excessive computer resource usage caused by determining the target program switch according to the multiple switch values ​​at the same time can be avoided, thereby improving the determination efficiency.

[0159] According to an embodiment of the present disclosure, the sorting results can be stored so that when a call is requested again, the corresponding switch value can be processed according to the stored sorting results, thereby improving the efficiency of determining the target program switch called by the request.

[0160] Figure 5 The following schematically illustrates a method for storing sorting results according to an embodiment of the present disclosure.

[0161] like Figure 5 As shown, the request response method of this embodiment includes operations S510 to S530.

[0162] In operation S510 , switch values ​​corresponding to respective switch fields are determined according to the plurality of switch fields.

[0163] In operation S520 , hash sorting is performed on the plurality of switch fields according to the switch values ​​corresponding to the plurality of switch fields to obtain a sorting result.

[0164] In operation S530 , the sorting result is stored.

[0165] Figure 6 The following schematically illustrates a target program switch calling method according to an embodiment of the present disclosure.

[0166] like Figure 6 As shown, the request response method of this embodiment includes operations S610 to S670.

[0167] In operation S610 , a request from a client is received.

[0168] In operation S620 , an annotation processing tool is used to query and obtain a switch value corresponding to the requested annotation information.

[0169] In operation S630 , hash sorting is performed on the plurality of switch fields according to the switch values ​​corresponding to the plurality of switch fields to obtain a sorting result.

[0170] In operation S640 , according to the sorting result, the switch values ​​corresponding to the plurality of switch fields are processed to determine the target program switches corresponding to the plurality of switch fields.

[0171] In operation S650 , is it determined whether the target program switch is in the on state? If yes, operation S660 is performed; if not, operation S670 is performed.

[0172] In operation S660, a method corresponding to the target program switch is called.

[0173] In operation S670, a preset method is called through a reflection calling method.

[0174] According to an embodiment of the present disclosure, the request is a switch state change request, and the switch value also includes a state change switch value, which is used to change the on or off state of the target program switch. The request response method further includes: changing the state of the target program switch according to the state change switch value, thereby obtaining the changed target program switch.

[0175] According to an embodiment of the present disclosure, the state of the target program switch is changed by changing the switch value according to the state to obtain the changed target program switch, thereby achieving the change of the switch state of the target program switch.

[0176] According to an embodiment of the present disclosure, the request response method further includes: when the annotation information further includes switch processing period information, processing the switch value according to the switch processing period information.

[0177] According to embodiments of the present disclosure, switch processing period information can be used to determine the switch period for processing a switch value. For example, annotation information can be parsed to obtain a switch field and the switch processing period information for that switch field. Thus, the switch value corresponding to the switch field can be processed according to the switch processing period information to determine the target program switch corresponding to the switch value.

[0178] According to the embodiment of the present disclosure, by processing the switch value according to the switch processing period information, the flexibility of processing the switch value is improved.

[0179] Based on the above request response method, the present disclosure also provides a request response device. Figure 7 The device is described in detail.

[0180] Figure 7 The following schematically shows a structural block diagram of a request response device according to an embodiment of the present disclosure.

[0181] like Figure 7 As shown, the request response device 700 of this embodiment includes a query module 710 , a first determination module 720 and a second determination module 730 .

[0182] Query module 710 is configured to, in response to receiving a request, use an annotation processing tool to query the annotation information in the request and obtain a switch value corresponding to the annotation information. The annotation information is used to determine the target program switch invoked by the request. The switch value includes a master switch value and a program switch value. The program switch value includes an address identification field value, which is used to determine the invocation address of the target program switch. In one embodiment, query module 710 can be configured to perform operation S210 described above and will not be further described here.

[0183] The first determining module 720 is configured to determine, when the master switch value indicates that the master switch is on, a plurality of to-be-determined program switches corresponding to the master switch based on the master switch value. In one embodiment, the first determining module 720 may be configured to execute the operation S220 described above, which will not be described in detail herein.

[0184] The second determination module 730 is configured to match the address identification field value with the address identification field values ​​of the multiple pending program switches, and determine a target program switch from the multiple pending program switches, wherein the address identification field value matches the address identification field value of the target program switch. In one embodiment, the second determination module 730 can be configured to perform operation S230 described above, and will not be further described here.

[0185] According to an embodiment of the present disclosure, the request response device further includes a third determination module and an execution module. The third determination module is configured to determine, based on the master switch value, at least one disable switch value corresponding to the master switch; and the execution module is configured to execute a processing operation on the request if one of the at least one disable switch values ​​matches the first custom switch value.

[0186] According to an embodiment of the present disclosure, the request response device further includes a fourth determination module and a fifth determination module. The fourth determination module is configured to determine, based on the master switch value, at least one call permission switch value corresponding to the master switch if no switch value matches the first custom switch value among at least one disable switch value; and the fifth determination module is configured to determine that the request has call permission if no call permission switch value matches the second custom switch value among at least one call permission switch value.

[0187] According to an embodiment of the present disclosure, the second determination module 730 includes a first determination submodule, a second determination submodule, and a third determination submodule. The first determination submodule is configured to match an address identification field value with a plurality of to-be-determined address identification field values, and determine a target address identification field value from the plurality of to-be-determined address identification field values, wherein the target address identification field value matches the address identification field value; the second determination submodule is configured to match an object identification field value with a plurality of to-be-determined object identification field values ​​of program switches to be determined, and determine a target object identification field value from the plurality of to-be-determined object identification field values, wherein the plurality of to-be-determined object identification field values ​​correspond to the plurality of to-be-determined program switches, and the target object identification field value matches the object identification field value; and the third determination submodule is configured to determine a target program switch from the plurality of to-be-determined program switches based on the target address identification field value and the target object identification field value.

[0188] According to an embodiment of the present disclosure, the first determination submodule includes a first determination unit and a second determination unit. The first determination unit is used to match the address identification field value of the i-th level with multiple address identification field values ​​to be determined at the i-th level, and determine the target address identification field value of the i-th level from the multiple address identification field values ​​to be determined at the i-th level, wherein the target address identification field value of the i-th level matches the address identification field value of the i-th level, and the target address identification field value of the i-th level corresponds to multiple address identification field values ​​to be determined at the i+1-th level, wherein i is a positive integer less than 1; the second determination unit is used to match the address identification field value of the i-th level with multiple address identification field values ​​to be determined at the i-th level, and determine the target address identification field value from the multiple address identification field values ​​to be determined at the i-th level, wherein the target address identification field value matches the address identification field value of the i-th level.

[0189] According to an embodiment of the present disclosure, the query module 710 includes a parsing submodule and a query submodule. The parsing submodule is used to parse the annotation information to obtain multiple switch fields; the query submodule is used to query and obtain the switch values ​​corresponding to the multiple switch fields.

[0190] According to an embodiment of the present disclosure, the query module 710 further includes a sorting submodule and a processing submodule. The sorting submodule is configured to perform a hash sort on the multiple switch fields based on the switch values ​​corresponding to the multiple switch fields to obtain a sorting result; and the processing submodule is configured to process the switch values ​​corresponding to the multiple switch fields according to the sorting result.

[0191] According to an embodiment of the present disclosure, the request response device further includes a change module, wherein the change module is configured to change the state of the target program switch according to the state change switch value to obtain the changed target program switch.

[0192] According to an embodiment of the present disclosure, the request response device further includes a sixth determination module configured to determine that the program switch to be determined is a target program switch if the program switch to be determined includes a full switch value and the full switch value representation matches.

[0193] According to an embodiment of the present disclosure, the request response device further includes a processing module, wherein the processing module is configured to process the switch value according to the switch processing period information when the annotation information further includes the switch processing period information.

[0194] According to an embodiment of the present disclosure, any multiple modules in the query module 710, the first determination module 720, and the second determination module 730 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the query module 710, the first determination module 720, and the second determination module 730 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in an appropriate combination of any of them. Alternatively, at least one of the query module 710, the first determination module 720, and the second determination module 730 can be at least partially implemented as a computer program module, which can perform the corresponding function when the computer program module is executed.

[0195] Figure 8 A block diagram of an electronic device suitable for implementing the request response method according to an embodiment of the present disclosure is schematically shown.

[0196] like Figure 8 As shown, the electronic device 800 according to an embodiment of the present disclosure includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 into a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include an onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0197] Various programs and data required for the operation of the electronic device 800 are stored in the RAM 803. The processor 801, ROM 802, and RAM 803 are connected to each other via a bus 804. The processor 801 executes the various operations of the method flow according to the embodiment of the present disclosure by executing the programs in the ROM 802 and / or RAM 803. It should be noted that the programs may also be stored in one or more memories other than the ROM 802 and RAM 803. The processor 801 may also execute the various operations of the method flow according to the embodiment of the present disclosure by executing the programs stored in the one or more memories.

[0198] According to an embodiment of the present disclosure, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to the bus 804. The electronic device 800 may further include one or more of the following components connected to the I / O interface 805: an input portion 806 including a keyboard, a mouse, etc.; an output portion 807 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and speakers; a storage portion 808 including a hard disk; and a communication portion 809 including a network interface card such as a LAN card or a modem. The communication portion 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed in the drive 810 as needed, so that a computer program read therefrom can be installed into the storage portion 808 as needed.

[0199] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or may exist independently and not be incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, and when executed, implements the method according to the embodiments of the present disclosure.

[0200] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 802 and / or RAM 803 described above and / or one or more memories other than ROM 802 and RAM 803.

[0201] The embodiments of the present disclosure also include a computer program product, which includes a computer program containing program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the request response method provided by the embodiments of the present disclosure.

[0202] The computer program executes the above functions defined in the system / device of the embodiment of the present disclosure when the computer program is executed by the processor 801. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0203] In one embodiment, the computer program may be stored on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may be transmitted and distributed in the form of a signal on a network medium, downloaded and installed via the communication portion 809, and / or installed from a removable medium 811. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to wireless, wired, or any suitable combination thereof.

[0204] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 809, and / or installed from a removable medium 811. When the computer program is executed by the processor 801, the above-described functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the systems, devices, means, modules, units, etc. described above can be implemented by computer program modules.

[0205] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, python, "C" or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect via the Internet).

[0206] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0207] Those skilled in the art will appreciate that the features described in the various embodiments and / or claims of this disclosure may be combined and / or coupled in various ways, even if such combinations and / or couplings are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure may be combined and / or coupled in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or couplings are intended to fall within the scope of this disclosure.

[0208] The embodiments of the present disclosure are described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although each embodiment has been described separately above, this does not mean that the measures in each embodiment cannot be used in combination to advantage. The scope of the present disclosure is defined by the appended claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A request response method, comprising: In response to receiving a request, querying and obtaining a switch value corresponding to the annotation information based on the annotation information of the request using an annotation processing tool, including: parsing the annotation information to obtain a plurality of switch fields; querying and obtaining a switch value corresponding to each of the plurality of switch fields based on the plurality of switch fields; performing hash sorting on the plurality of switch fields based on the switch values ​​corresponding to each of the plurality of switch fields to obtain a sorting result; and processing the switch values ​​corresponding to each of the plurality of switch fields according to the sorting result; wherein the annotation information is used to determine a target program switch called by the request, the switch value includes a total switch value and a program switch value, the program switch value includes an address identification field value and an object identification field value, and the address identification field value is used to determine a calling address of the target program switch; In a case where the main switch value indicates that the main switch is on, determining a plurality of to-be-determined program switches corresponding to the main switch according to the main switch value; The address identification field value is matched with the address identification field values ​​to be determined of the multiple program switches to be determined, and the object identification field value is matched with the object identification field values ​​to be determined of the multiple program switches to be determined, so as to determine the target program switch from the multiple program switches to be determined, wherein the object identification field value matches the target object identification field value of the target program switch; and the address identification field value matches the address identification field value of the target program switch.

2. The method according to claim 1, wherein The switch value further includes a first custom switch value, wherein the first custom switch value is used to determine whether the request calls a program switch that prohibits calling; When the main switch value indicates that the main switch is on, before determining a plurality of to-be-determined program switches corresponding to the main switch according to the main switch value, the method further includes: determining, based on the master switch value, at least one disable switch value corresponding to the master switch; If there is a disable switch value matching the first custom switch value among the at least one disable switch value, a processing operation on the request is performed.

3. The method according to claim 2, wherein: The switch value further includes a second custom switch value, and the second custom switch value is used to determine whether the request calls a program switch with calling permission; The method further comprises: If there is no switch value matching the first custom switch value among the at least one disabled switch value, determining at least one call permission switch value corresponding to the main switch according to the main switch value; If there is a calling permission switch value matching the second custom switch value among the at least one calling permission switch value, it is determined that the request has calling permission.

4. The method according to claim 1, wherein There are multiple address identification field values, and the multiple address identification field values ​​include I address identification field values ​​of different levels, where I is a positive integer; The step of matching the address identification field value with the multiple address identification field values ​​to be determined, and determining a target address identification field value from the multiple address identification field values ​​to be determined, includes: Matching the address identification field value of the i-th level with multiple address identification field values ​​to be determined at the i-th level, and determining the target address identification field value of the i-th level from the multiple address identification field values ​​to be determined at the i-th level, wherein the target address identification field value of the i-th level matches the address identification field value of the i-th level, and the target address identification field value of the i-th level corresponds to multiple address identification field values ​​to be determined at the i+1-th level, where i is a positive integer less than 1; Match the address identification field value of the first level with multiple address identification field values ​​to be determined of the first level, and determine the target address identification field value from the multiple address identification field values ​​to be determined of the first level, wherein the target address identification field value matches the address identification field value of the first level.

5. The method according to claim 1, wherein the request is a switch state change request, and the switch value further comprises a state change switch value, wherein the state change switch value is used to change the on state or off state of the target program switch; The method further comprises: According to the state change switch value, the state of the target program switch is changed to obtain a changed target program switch.

6. The method according to claim 1, further comprising: In a case where the program switch to be determined includes a full switch value and the full switch value representation matches, the program switch to be determined is determined to be the target program switch.

7. The method according to claim 1, further comprising: In a case where the annotation information further includes switch processing period information, the switch value is processed according to the switch processing period information.

8. A request response device, comprising: A query module, configured to, in response to receiving a request, query and obtain a switch value corresponding to the annotation information of the request using an annotation processing tool, comprising: parsing the annotation information to obtain a plurality of switch fields; querying and obtaining a switch value corresponding to each of the plurality of switch fields based on the plurality of switch fields; performing hash sorting on the plurality of switch fields based on the switch values ​​corresponding to each of the plurality of switch fields to obtain a sorting result; and processing the switch values ​​corresponding to each of the plurality of switch fields according to the sorting result; wherein the annotation information is used to determine a target program switch called by the request, the switch value includes a total switch value and a program switch value, the program switch value includes an address identification field value and an object identification field value, and the address identification field value is used to determine a calling address of the target program switch; a first determining module, configured to determine, according to the main switch value, a plurality of to-be-determined program switches corresponding to the main switch when the main switch value indicates that the main switch is on; The second determining module is configured to match the address identification field value with the address identification field values ​​to be determined of the multiple program switches to be determined, and to match the object identification field value with the object identification field values ​​to be determined of the multiple program switches to be determined, so as to determine the target program switch from the multiple program switches to be determined, wherein the object identification field value matches the target object identification field value of the target program switch; and the address identification field value matches the address identification field value of the target program switch.

9. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are enabled to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to perform the method according to any one of claims 1 to 7.

11. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Service calling and providing method and device, electronic equipment, medium and program product

    CN114490136A

  • Data caching method and apparatus, and electronic device

    WO2023056946A1