Service access control method, device and system and computing equipment
By configuring conditional expressions in the function control server and intercepting the execution of business function method bodies, the problems of forced intrusion and repeated development of business code are solved, and dynamic control management and development efficiency are improved.
Patent Information
- Application Number
- CN202310761273.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-26
- Publication Date
- 2024-12-27
AI Technical Summary
In the prior art, the cutting-off control process of business functions leads to strong intrusion of business code, and different applications require separate functional development, resulting in low development efficiency and waste of resources.
By configuring the conditional expressions of business functions and control conditions in the function control server, intercepting the execution of the method body of the target business function, controlling the execution of the method body based on the execution result of the conditional expression, realizing dynamic control management, decoupling the control logic and service Logic, avoid repeated development.
It realizes dynamic control and management of target business functions, reduces the difficulty of operating and maintaining system codes, improves development efficiency, and avoids waste of resources.
Smart Images

Figure CN119210744A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method and apparatus, system and computing device for controlling service access. Background Art
[0002] The business functions of an application need to be continuously upgraded and maintained, and new functions are usually released gradually. At the same time, some new functions are only effective at fixed times. Such business functions need to be controlled in quantity to meet their business needs.
[0003] In the related art, the control code of such business functions is usually interspersed with the business logic code, resulting in strong intrusion of the business code and affecting the maintenance and management of the business code. In addition, different applications need to be developed separately, resulting in low development efficiency and waste of resources due to repeated development.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the embodiments of the present disclosure is to provide a method and apparatus, system and computing device for controlling business access, thereby solving to a certain extent the problem of strong intrusion of business codes caused by the volume control process in related technologies and the problem of low development efficiency and waste of resources caused by separate control development of different applications.
[0006] According to a first aspect of the present disclosure, a method for controlling business access is provided, the method comprising: in response to receiving a business access request for a target business function, intercepting a method body corresponding to the target business function before execution; the method body comprises a control condition for the target business function; in business function control data, matching a conditional expression corresponding to the control condition, the business function control data being a data model in which a business function corresponds to a conditional expression of the control condition of the business function in a one-to-one manner, the data model being formed based on configuration data obtained from a function control server; executing the conditional expression, and based on the execution result, controlling the execution of the method body to complete access to the target business function.
[0007] Optionally, the method also includes: in response to the startup of the business server, synchronizing the data model from the function control server to the local cache, the data model being a key-value pair data storage model, wherein the key data is the description information of the business function, and the value data is the conditional expression of the control condition of the business function.
[0008] Optionally, the pre-execution interception of the method body corresponding to the target business function includes: determining the control conditions of the target business function, the control conditions being configured in a declarative manner; using the control conditions as filtering conditions for the pre-execution interception, and intercepting the method body before execution, the method body being formed by embedding the control conditions into the business logic code of the target business function.
[0009] Optionally, controlling the execution of the method body according to the execution result includes: in response to the execution result being true, controlling the execution of the method body; and in response to the execution result being false, controlling not to execute the method body.
[0010] Optionally, the method further includes: in response to the conditional expression not being matched in the business function control data, controlling not to execute a method body corresponding to the target business function.
[0011] Optionally, the method further includes: in response to a data change in the data storage model, receiving a data change notification pushed in real time by the function control server; and updating the business function control data cached locally according to the data change notification.
[0012] According to a second aspect of the present disclosure, a business access control device is provided, the device comprising: an interception module, a matching module and a control module, wherein: the interception module is used to intercept a method body corresponding to a target business function before execution in response to receiving a business access request for the target business function; the method body comprises the control conditions of the target business function; the matching module is used to match a conditional expression corresponding to the control condition in business function control data, the business function control data is a data model in which a business function corresponds to a conditional expression of the control condition of the business function in a one-to-one manner, and the data model is formed based on configuration data obtained from a function control server; the control module is used to execute the conditional expression and, based on the execution result, control the execution of the method body to complete the access to the target business function.
[0013] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method described in any one of the above embodiments is implemented.
[0014] According to a fourth aspect of the present disclosure, a computing device is provided, comprising: one or more processors; and a storage device for 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 method described in any one of the above embodiments.
[0015] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is run on a computer, the computer executes the method described in any one of the above embodiments.
[0016] According to a sixth aspect of the present disclosure, a control system for business access is provided, the system comprising: a function control server, for synchronizing the business function control data to a business server, the business function control data being a data model in which a business function formed based on configuration data corresponds to a conditional expression of a control condition of the business function one-to-one; a business server, for, in response to receiving a business access request for a target business function, intercepting a method body corresponding to the target business function before execution; the method body comprising the control condition of the target business function; and matching the conditional expression corresponding to the control condition in the business function control data, executing the conditional expression, and controlling the execution of the method body based on the execution result to complete access to the target business function.
[0017] Optionally, the business function control data also includes the validity period of the business function, and the function control server is further used to: poll and detect the validity period of each of the business functions; in response to a business function exceeding the corresponding validity period, send an expiration notification to the terminal to take offline the control conditions corresponding to the expired business function.
[0018] Optionally, the function control server is further used to: pull the business function control data locally cached by the business server in real time to confirm whether the business function control data is synchronized successfully.
[0019] The exemplary embodiments of the present disclosure may have some or all of the following beneficial effects:
[0020] In the business access control method provided in the example implementation mode of the present disclosure, on the one hand, the method body corresponding to the target business function can be intercepted before execution, and the control conditions of the target business function in the intercepted method body can be matched with the corresponding conditional expression in the business function control data, and the execution of the method body can be controlled according to the expression execution result, thereby realizing dynamic control and management of the target business function during operation, and meeting the various business form requirements of different application business systems. On the other hand, by configuring the configuration data of the conditional expression of the one-to-one corresponding business function and the control condition of the business function in the function control server, and matching the corresponding conditional expression in combination with the control conditions in the method body, the decoupling of the control logic and the business logic is realized, the strong intrusion of the business code is avoided, and the difficulty of operation and maintenance of the system code is reduced. In addition, the repeated development of the control logic of the target business function by different applications can be avoided, the development efficiency is improved, and the development resources are saved.
[0021] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0023] Figure 1 A system architecture diagram of a method for controlling service access according to an embodiment of the present disclosure is schematically shown.
[0024] Figure 2 One of the flowcharts of a method for controlling service access according to an embodiment of the present disclosure is schematically shown.
[0025] Figure 3 The diagram schematically shows the data flow process inside the function control server and between the function control server and the service server according to an embodiment of the present disclosure.
[0026] Figure 4 A second flowchart of a method for controlling service access according to another embodiment of the present disclosure is schematically shown.
[0027] Figure 5 The structure block diagram of a device for controlling service access according to an embodiment of the present disclosure is schematically shown.
[0028] Figure 6 The structural block diagram of a control system for service access according to an embodiment of the present disclosure is schematically shown.
[0029] Figure 7 A block diagram of a computing device suitable for implementing embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0030] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0031] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0032] Figure 1 1 is a schematic structural diagram of a method and device system architecture 100 for controlling service access provided in an embodiment of the present application. Figure 1 As shown, the system 100 includes: a service server 110, a function control server 120, a first terminal 130, and a second terminal 140. In the embodiment of the present invention, the service server 110 is connected to the first terminal 130 for communication, so that data or information can be exchanged between the service server 110 and the first terminal 130. In addition, the function control server 120 is connected to the second terminal 140 for communication, so that data or information can be exchanged between the function control server 120 and the second terminal 140. The communication connection between the service server 110 and the function control server 120 can realize the synchronization of service function control data.
[0033] As an example but not limitation, in an embodiment of the present invention, the service server 110 and the first terminal 130, and the function control server 120 and the second terminal 140 can communicate directly through a network such as Ethernet (for example, implemented through a communication cable such as an optical fiber). Alternatively, they can also communicate indirectly through a forwarding network composed of one or more network devices. As an example but not limitation, for example, the first terminal 130 can use wireless communication to communicate indirectly with the service server 110 through an access network and a core network.
[0034] In an embodiment of the present invention, a user sends a service access request to a service server 110 through a first terminal 130, and the first terminal 130 can obtain the requested service data from the service server 110, so that the service can be presented to the user based on the data of the service, for example, displaying a page, running an application, playing audio or video, etc. In an embodiment of the present invention, the page displayed by the first terminal 130 can be a web page or a user page (or user interface) of an application, etc., which is not particularly limited in the present invention. In an embodiment of the present invention, a developer can configure service function control data to a function control server 120 through a second terminal 140, and the first terminal 130 and the second terminal 140 are also configured with an input device, so that the input device can be operated to achieve control of the service. As an example and not a limitation, as the input device, one or more of a touch operation detection device, a gesture operation detection device, a keyboard, a mouse or a voice recognition device can be listed.
[0035] As an example and not a limitation, the first terminal 130 and the second terminal 140 may be a computing device, a tablet computer or a smart phone, etc., and this example does not specifically limit this. In an embodiment of the present invention, the business server 110 or the function control server 120 may be a device that provides computing services. Since the server needs to respond to service requests and perform processing, the server should generally have the ability to undertake and guarantee services. The business server 110 or the function control server 120 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms, or a node in a blockchain, and this example does not specifically limit this.
[0036] The following describes the service access control method disclosed in the embodiments of this specification in conjunction with specific embodiments.
[0037] refer to Figure 2As shown, a method for controlling service access according to an exemplary embodiment of the present disclosure is applied to a service server and may include the following steps.
[0038] Step S210 , in response to receiving a service access request for a target service function, intercepting a method body corresponding to the target service function before execution; the method body includes a control condition of the target service function.
[0039] Step S220, matching the conditional expression corresponding to the control condition in the business function control data, the business function control data is a data model in which the business function corresponds to the conditional expression of the control condition of the business function, and the data model is formed based on the configuration data obtained from the function control server.
[0040] Step S230, executing the conditional expression, and controlling the execution of the method body according to the execution result to complete the access to the target business function.
[0041] In the business access control method provided in this example implementation, on the one hand, the method body corresponding to the target business function can be intercepted before execution, and the control conditions of the target business function in the intercepted method body can be matched with the corresponding conditional expression in the business function control data, and the execution of the method body can be controlled according to the expression execution result, thereby realizing dynamic control and management of the target business function during operation, and meeting the various business form requirements of different application business systems. On the other hand, by configuring the configuration data of the conditional expression of the one-to-one corresponding business function and the control condition of the business function in the function control server, and matching the corresponding conditional expression in combination with the control conditions in the method body, the decoupling of the control logic and the business logic is realized, the strong intrusion of the business code is avoided, and the difficulty of operation and maintenance of the system code is reduced. In addition, the repeated development of the control logic of the target business function by different applications can be avoided, the development efficiency can be improved, and the development resources can be saved.
[0042] The following describes each step of the present disclosure in more detail.
[0043] In step S210 , in response to receiving a service access request for a target service function, a method body corresponding to the target service function is intercepted before execution.
[0044] In this example implementation, the target business function refers to a business function that needs to be volume controlled, and volume control refers to the switching control of business functions based on different dimensions. For example, the volume control launch of new functions developed for business functions to be upgraded, the switching control of business functions with execution deadline requirements, or other controls that require switching business functions, this example does not limit this. Different dimensions may include dimensions such as goods, user PIN (Personal Identification Number), IP address, traffic, time, and other dimensions, and may also include other dimensions, this example does not limit this. Exemplarily, the volume control based on the commodity dimension can be a business function control for a specified commodity SKU (unique code of the inventory unit) (such as the seven fresh business, the Spring Festival non-closing business, etc.), and the volume control based on the traffic dimension can be a traffic control for the launch of a new function, that is, switching the business access traffic of a certain period of time to the new function according to the traffic ratio.
[0045] In this example implementation, the service access request may be generated based on a corresponding operation or input of a user on the client where the application is located. For example, in response to a user searching for a product on the application interface, a search service access request for the search keyword may be generated.
[0046] In this example implementation, the method body refers to a code block that implements a specific function in the implementation class of the target business function. The method body may include the control condition of the target business function and the business logic code of the target business function; the control condition is used to determine whether to execute the business logic code.
[0047] For example, for any business function, the corresponding method body is:
[0048] @FeatureToggle(desc="XXXX", condition="XXXX")
[0049] public void splitSku(){
[0050] / / Business logic code
[0051] }
[0052] Among them, FeatureToggle represents the feature switch; desc represents the description of the switch; condition represents the control condition, the first line represents the control condition code of the target business function, and "XXXX" represents the specific description information and the control condition code. It can be seen from this example that the business logic code and the control condition code of the present invention are separated from each other.
[0053] In some embodiments, in response to the startup of the service server, the service function control data is synchronized from the function control server to the local cache.
[0054] In this example implementation, the business function control data is a key-value data storage model formed based on the configuration data of the function control server, wherein the key data is the description information of the business function, which can be described in String format and is used to describe the function connection point that needs to be cut. The value data is the conditional expression of the control condition of the business function, and the SpEL (Spring Expression Language) language description can be used to judge the truth value of the conditional expression. SpEL is a powerful expression language that supports querying and manipulating objects at runtime. In this way, Spring's SpEL language can be used to operate objects at runtime, and the filtering conditions intercepted before execution can be dynamically judged at runtime.
[0055] For example, the conditional expression corresponding to the "XXX" business function is XXX=#SKU XX in('XX','XX','XX','XX'), where "XX" represents a specific dimension and condition, which may be a specific user identification code or product SKU, etc.
[0056] In this example implementation, if Figure 3 As shown, developers can enter and store configuration data through the operation and maintenance terminal corresponding to the function control server, and then store the configuration data in key-value mode to form a KV model. When the business system (business server) is started, the stored data in the KV model is synchronized to the feature switch of the business server to perform volume control in the subsequent business access process.
[0057] In some embodiments, in response to a data change in a data storage model, a data change notification pushed in real time by a function control server is received; and based on the data change notification, the locally cached business function control data is updated.
[0058] In this example implementation, in order to ensure the consistency of the configuration data in the business server and the function control server, when the configuration data of the function control server is changed, such as Figure 3 As shown, the function control server notifies the business server of the changed data by real-time push data change notification, so that the business server updates the locally cached business function control data according to the notification. The data change notification may include information such as the data before and after the change, the change time, and the change type, which is not limited in this example.
[0059] In this example implementation, if Figure 3As shown, the function control server can determine whether the business server has completed the data update by pulling (such as reading) the business function control data locally cached by the business server. If it is determined that the data update has not been completed, an error alarm can be sent to the business server or the operation and maintenance terminal to report the error in a timely manner.
[0060] Exemplarily, the following steps may be used to intercept the method body corresponding to the target business function before execution.
[0061] Determine the control conditions for the target business function.
[0062] In this example implementation, the control conditions can be configured in a declarative manner. The feature switch (Agent) of the business server configures a declarative truncation switch in the form of a jar. The declarative truncation switch can be used for different business systems of different applications, avoiding the separate development of different business systems. Specifically, the business developer can embed the truncation switch into the business code (such as the FeatureToggle code segment in the above embodiment) according to business requirements, and control the flow of business logic at the method level. The feature switch uses the annotation method provided by java for declarative programming.
[0063] The control condition is used as the filtering condition for pre-execution interception to intercept the method body before execution.
[0064] In this example implementation, the method body is formed by embedding the control conditions into the business logic code of the target business function (such as the method body code of the previous embodiment). The AOP interception mechanism provided by the Spring framework can be used to filter and intercept the executed method; AOP (Aspect Oriented Programming) is a technology that achieves unified maintenance of program functions through pre-compilation and runtime dynamic proxy. AOP can be used to isolate various parts of the business logic, thereby reducing the coupling between the various parts of the business logic, improving the reusability of the program, and improving the efficiency of development.
[0065] In step S220, a conditional expression corresponding to the control condition is matched in the business function control data.
[0066] In this example implementation, the business function control data is a data model (KV model) in which a business function corresponds to a conditional expression of a control condition of the business function, and the data model is formed based on configuration data obtained from a function control server. The conditional expression corresponding to the control condition can be matched in the data model.
[0067] In some embodiments, if the conditional expression of the control condition fails to match, that is, the corresponding conditional expression is not found, it can be considered that the current access request does not meet the cut-off condition, and the corresponding method body is not executed. For example, for the new function cut-off upgrade process, the new function can be not executed, and the existing old function can be executed.
[0068] In step S230, the conditional expression is executed, and according to the execution result, the execution of the method body is controlled to complete the access to the target business function.
[0069] In this example implementation, when the conditional expression matches successfully, the conditional expression is executed, and its execution result can be true or false. When the execution result is true, it means that the current access request meets the cut-off condition, and the control executes the method body corresponding to the target business function. When the execution result is false, it means that the current access request does not meet the cut-off condition, and the control does not execute the method body corresponding to the target business function.
[0070] In some embodiments, the business function control data also includes the validity period of the business function, and the method also includes: the function control server polls and detects the validity period of each business function; in response to a business function exceeding the corresponding validity period, an expiration notification is sent to the terminal to take offline the control conditions corresponding to the expired business function.
[0071] In this example implementation, when the function control server configures data, the validity period corresponding to each service function can be configured, such as Figure 3 As shown, the validity period of each business function in the KV model can be detected through the Worker polling mechanism, and an expiration notification can be sent to the terminal where the operation and maintenance personnel are located for the expired business function, so as to offline the control conditions corresponding to the business function.
[0072] For example, the first line of control condition code in the above embodiment can be deleted: @FeatureToggle(desc="XXXX", condition="XXXX") to perform offline processing on the toggle control. This can ensure effective management of control logic code and avoid corruption of business code.
[0073] In some embodiments, the function control server may also perform version management on the service functions, that is, perform upgrade management on different function versions of the same service to achieve switching between different versions.
[0074] For example, Figure 4As shown, the control method of the service access disclosed in the present invention can be executed between the service server and the function control server. By developing a function control system on the function control server and cooperating with the characteristic switch running on the service server, the volume control of the service function can be realized. Specifically, it can be realized by the following steps S401-S408.
[0075] Step S401, start the business server, and synchronize the business function control data configured on the function control server to the local cache of the business server. The business function control data is a data model in which the business function corresponds to the conditional expression of the control condition of the business function.
[0076] Step S402: The user terminal sends a service access request for a target service function to a service server.
[0077] Step S403: The feature switch of the business server intercepts the method body corresponding to the target business function before execution.
[0078] Step S404: the business server searches for the cut-off switch declaration of the characteristic switch definition in the interception section to determine the control condition of the target business function.
[0079] Step S405: The business server matches the conditional expression corresponding to the control condition in the business function control data.
[0080] Step S406: The service server determines whether a conditional expression is matched. If so, the conditional expression is executed. Otherwise, the process goes to step S408.
[0081] Step S407, the business server determines whether the execution result is true, and if so, controls the execution of the method body corresponding to the target business function; otherwise, goes to step S408.
[0082] Step S408: The business server controls not to execute the method body corresponding to the target business function.
[0083] In the above embodiments, when the method body is not executed, that is, when the amount of control is not met, the original business logic can be executed and the request result can be returned.
[0084] The present invention is aimed at the development process of the existing truncation control business. Different applications or different business systems need to develop truncation functions based on their own technical frameworks, and cannot achieve the transplantation and reuse of general capabilities, resulting in a large waste of development resources. At the same time, the truncation control code is embedded in the business logic, so that the truncation control code and the normal business code are interspersed and affect each other, causing great interference to the subsequent code management and maintenance; and there is a lack of effective offline time management for the truncation switch. After the truncation is completed, the truncation code cannot be offline, causing problems such as corruption of the system code.
[0085] On the one hand, the present invention uses a distributed configuration center as a storage engine, and the truncation control switch adopts a Key-Value model for storage, so as to realize the truncation control during operation and facilitate the management of truncation business functions. On the other hand, by relying on JAVA's annotation specification feature switch, dynamic interception at the method level is performed through AOP to solve the problems of repeated construction of truncation switches and strong intrusion into business systems, and effectively improve the overall quality of system code.
[0086] The present invention solves various demands of different applications or business systems for cutting quantity by designing a distributed functional control system for cutting quantity demand, decouples the business logic and control logic in the business system, and reduces the complexity of system code operation and maintenance. At the same time, through polling detection and expiration notification mechanism, the cutting quantity switch can be offline in time, and the effective management of the cutting quantity control logic code can be achieved.
[0087] Furthermore, in this exemplary embodiment, a service access control device 500 is also provided. The service access control device 500 can be applied to a service server. Figure 5 As shown, the business access control device 500 may include: an interception module 510, a matching module 520 and a control module 530. The interception module 510 can be used to intercept the method body corresponding to the target business function before execution in response to receiving a business access request for the target business function; the method body includes the control conditions of the target business function; the matching module 520 can be used to match the conditional expression corresponding to the control condition in the business function control data, and the business function control data is a data model in which the business function corresponds to the conditional expression of the control condition of the business function, and the data model is formed based on the configuration data obtained from the function control server; the control module 530 can be used to execute the conditional expression and control the execution of the method body according to the execution result to complete the access to the target business function.
[0088] In an exemplary embodiment of the present disclosure, the device 500 may also include: a synchronization module, which is used to synchronize the data model from the function control server to the local cache in response to the startup of the business server, and the data model is a key-value pair data storage model, wherein the key data is the description information of the business function, and the value data is the conditional expression of the control condition of the business function.
[0089] In an exemplary embodiment of the present disclosure, the interception module 510 can also be used to: determine the control conditions of the target business function, the control conditions are configured in a declarative manner; use the control conditions as filtering conditions for pre-execution interception, and intercept the method body before execution, and the method body is formed by embedding the control conditions into the business logic code of the target business function.
[0090] In an exemplary embodiment of the present disclosure, the control module 530 may also be used to: in response to the execution result being true, control the execution of the method body; in response to the execution result being false, control the non-execution of the method body.
[0091] In an exemplary embodiment of the present disclosure, the control module 530 may also be used to: in response to failure to match a conditional expression in the business function control data, control non-execution of a method body corresponding to the target business function.
[0092] In an exemplary embodiment of the present disclosure, the device 500 also includes: a receiving module and an updating module. The receiving module can be used to respond to data changes in the data storage model and receive data change notifications pushed in real time by the function control server; the updating module can be used to update the locally cached business function control data according to the data change notification.
[0093] The specific details of each module or unit in the above-mentioned service access control device have been described in detail in the corresponding service access control method, so they will not be repeated here.
[0094] refer to Figure 6 In this example implementation, a control system for business access is also provided, the system 600 includes: a function control server 610 and a business server 620, wherein: the function control server 610 is used to synchronize business function control data to the business server, the business function control data is a data model in which a business function formed based on configuration data corresponds to a conditional expression of the control condition of the business function one by one; the business server 620 is used to intercept the method body corresponding to the target business function before execution in response to receiving a business access request for the target business function; the method body includes the control condition of the target business function; and in the business function control data, the conditional expression corresponding to the control condition is matched, the conditional expression is executed, and according to the execution result, the execution of the method body is controlled to complete the access to the target business function.
[0095] In an exemplary embodiment of the present disclosure, the business function control data also includes the validity period of the business function, and the function control server 610 is also used to: poll and detect the validity period of each business function; in response to a business function exceeding the corresponding validity period, send an expiration notification to the terminal to take offline the control conditions corresponding to the expired business function.
[0096] In an exemplary embodiment of the present disclosure, the function control server 610 is further used to: pull the service function control data cached locally by the service server in real time to confirm whether the service function control data is synchronized successfully.
[0097] The specific details of each module or server in the above-mentioned service access control system have been described in detail in the corresponding service access control method, so they will not be repeated here.
[0098] As another aspect, the present application also provides a computer-readable medium, which may be included in the computing device described in the above embodiments; or may exist independently without being assembled into the computing device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a computing device, the computing device implements the method in the following embodiments. For example, the computing device may implement Figure 2 to Figure 4 The various process steps shown, etc.
[0099] It should be noted that the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. 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, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0100] Refer to the following Figure 7 700 according to this embodiment of the present disclosure is described. Figure 7 The computing device 700 shown is only an example and should not bring any limitation to the functionality and scope of use of the embodiments of the present disclosure.
[0101] like Figure 7 As shown, the computing device 700 is in the form of a general computing device. The components of the computing device 700 may include, but are not limited to: the at least one processing unit 710, the at least one storage unit 720, a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710), and a display unit 740.
[0102] The storage unit stores program codes, which can be executed by the processing unit 710, so that the processing unit 710 executes the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.
[0103] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 7201 and / or a cache storage unit 7202 , and may further include a read-only storage unit (ROM) 7203 .
[0104] The storage unit 720 may also include a program / utility 7204 having a set (at least one) of program modules 7205, such program modules 7205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0105] Bus 730 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0106] The computing device 700 may also communicate with one or more external devices 770 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the computing device 700, and / or communicate with any device that enables the computing device 700 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 750. Furthermore, the computing device 700 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 760. As shown, the network adapter 760 communicates with other modules of the computing device 700 via a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the computing device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RA identification systems, tape drives, and data backup storage systems.
[0107] In an exemplary embodiment, a computer program product is also provided, which may include, for example, a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code; when the computer program product runs on a computer, the computer executes the method in the above embodiment.
[0108] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.
[0109] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0110] It should be noted that, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in the specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc., which shall all be considered as part of the present disclosure.
[0111] It should be understood that the disclosure disclosed and defined in this specification extends to all alternative combinations of two or more individual features mentioned or evident in the text and / or the accompanying drawings. All these different combinations constitute multiple alternative aspects of the disclosure. The embodiments of this specification illustrate the best mode known for implementing the disclosure and will enable those skilled in the art to utilize the disclosure.
Claims
1. A method for controlling service access, applied to a service server, characterized in that: include: In response to receiving a service access request for a target service function, intercepting a method body corresponding to the target service function before execution; The method body includes control conditions of the target business function; In the business function control data, a conditional expression corresponding to the control condition is matched, the business function control data is a data model in which a business function corresponds to a conditional expression of the control condition of the business function in a one-to-one manner, and the data model is formed based on configuration data obtained from the function control server; The conditional expression is executed, and according to the execution result, the execution of the method body is controlled to complete the access to the target business function.
2. The service access control method according to claim 1, characterized in that: The method further comprises: In response to the startup of the business server, the data model is synchronized from the function control server to the local cache, the data model is a key-value data storage model, wherein the key data is the description information of the business function and the value data is the conditional expression of the control condition of the business function.
3. The service access control method according to claim 1 or 2, characterized in that: The method body corresponding to the target business function is intercepted before execution, including: Determining a control condition of the target business function, wherein the control condition is configured in a declarative manner; The control condition is used as a filter condition for the pre-execution interception to intercept the method body before execution. The method body is formed by embedding the control condition into the business logic code of the target business function.
4. The service access control method according to claim 1, characterized in that: The controlling the execution of the method body according to the execution result includes: In response to the execution result being true, controlling the execution of a method body corresponding to the target business function; In response to the execution result being false, controlling not to execute a method body corresponding to the target business function.
5. The service access control method according to claim 1, characterized in that: The method further comprises: In response to the conditional expression not being matched in the business function control data, controlling not to execute a method body corresponding to the target business function.
6. The service access control method according to claim 2, characterized in that: The method further comprises: In response to a data change in the data storage model, receiving a data change notification pushed in real time by the function control server; The business function control data cached locally is updated according to the data change notification.
7. A service access control device, characterized in that: The device comprises: An interception module, configured to intercept a method body corresponding to a target business function before execution in response to receiving a business access request for the target business function; the method body includes a control condition of the target business function; A matching module, used to match the conditional expression corresponding to the control condition in the business function control data, wherein the business function control data is a data model in which a business function corresponds to the conditional expression of the control condition of the business function in a one-to-one manner, and the data model is formed based on the configuration data obtained from the function control server; The control module is used to execute the conditional expression and control the execution of the method body according to the execution result to complete the access to the target business function.
8. A control system for service access, characterized in that: The system comprises: A function control server, used to synchronize the business function control data to a business server, wherein the business function control data is a data model in which a business function formed based on the configuration data corresponds to a conditional expression of a control condition of the business function in one-to-one correspondence; A business server, configured to intercept a method body corresponding to a target business function before execution in response to receiving a business access request for the target business function; the method body includes a control condition of the target business function; and In the business function control data, a conditional expression corresponding to the control condition is matched, the conditional expression is executed, and according to the execution result, the execution of the method body is controlled to complete the access to the target business function.
9. The service access control system according to claim 8, characterized in that: The service function control data also includes the validity period of the service function, and the function control server is further used for: Polling to detect the validity period of each of the business functions; In response to the service function exceeding the corresponding validity period, an expiration notification is sent to the terminal to perform offline processing on the control condition corresponding to the expired service function.
10. The service access control system according to claim 8, characterized in that: The function control server is also used for: Pull the business function control data locally cached by the business server in real time to confirm whether the business function control data is synchronized successfully.
11. A computing device, characterized in that: include: one or more processors; as well as A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the method according to any one of claims 1 to 6.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.