Intermediate data construction method and device, storage medium and electronic device
By constructing intermediate data in API, the interface information is solved according to the department interface authority of the target object, and the abuse of API abuse is solved, and the effective constraints of interface permissions and the optimization of resources are realized.
Patent Information
- Application Number
- CN202411386545.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-28
AI Technical Summary
When it is necessary to build intermediate data through APIs, all APIs can be used in different development departments without permission to restrict the contract, resulting in the possible abuse of APIs.
By determining the interface permissions of the department where the target object is located, the target object has the first interface information with the use permissions, and sends it to the target object to build the intermediate data according to the first interface information.
Effectively avoid the abuse of APIs, ensure that the development department can only use its permissions interfaces, thereby optimizing the efficiency of resource use and development.
Smart Images

Figure CN119376706A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart home technology, and more specifically, to a method and device for constructing intermediate data, a storage medium, and an electronic device. Background Art
[0002] With the development of Internet of Things technology, various smart home devices are gradually connected to the Internet, and the release of applications (Application, referred to as APP) has a fixed cycle. In addition, due to the fact that H5 (Hypertext Markup Language 5) in the Hybrid development mode has the advantages of iteration without being affected by versions, fast development, and the main purpose is display and user interaction. Using H5 to develop smart device control pages has become a better choice.
[0003] The display and operation of H5 heavily rely on webviews. There are certain differences between webviews on different platforms or systems. To facilitate business development and realize multi-terminal operation of one set of code, it is necessary to insert an intermediate plug-in layer between H5 and the platform native layer to smooth out the differences between webviews. However, the current intermediate plug-in layer has certain defects, such as: it does not distinguish between all APIs exposed by the platform, there is code redundancy, and the current plug-in layer is used in different development departments without permission restrictions, which is easy to cause abuse.
[0004] Regarding the related technology, when it is necessary to build intermediate data through an application programming interface (API, i.e. the interface of this application), all APIs can be used in different development departments without any authority restrictions, which may lead to the problem of API abuse, and no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present application provide a method and device for constructing intermediate data, a storage medium and an electronic device, so as to at least solve the problem in the related art that when intermediate data needs to be constructed through an API, all APIs can be used in different development departments without authority restrictions, which may lead to the problem of API abuse.
[0006] According to an embodiment of the present application, a method for constructing intermediate data is provided, including: determining permission information of a target object, wherein the permission information includes: interface permissions of the department to which the target object belongs; determining first interface information based on the permission information, wherein the target object has permission to use a first interface corresponding to the first interface information; and sending the first interface information to the target object so that the target object constructs intermediate data based on the first interface information.
[0007] In an exemplary embodiment, determining the permission information of the target object includes: acquiring identification information of the target object; and determining the permission information of the target object in a permission system according to the identification information.
[0008] In an exemplary embodiment, before determining the first interface information based on the permission information, the method also includes: constructing a script file based on the permission information; filtering a second interface list based on the script file, wherein the second interface list is applied to indicate that the second interface corresponds to the second interface information, and the target object does not have permission to use the second interface corresponding to the second interface information; filtering the second interface information in the target interface information based on the second interface list, wherein the target interface information is the interface information stored in the interface database.
[0009] In an exemplary embodiment, determining the first interface information based on the permission information includes: constructing a script file based on the permission information; filtering a first interface list based on the script file, wherein the first interface list is used to indicate the first interface; generating a declaration file, an interface file, and an interface description file corresponding to the first interface based on the first interface list, wherein the first interface information includes at least: a declaration file, an interface file, and the interface description file corresponding to the first interface.
[0010] In an exemplary embodiment, sending the first interface information to the target object so that the target object constructs intermediate data according to the first interface information includes: sending the first interface information to the target object so that the first interface with usage permission is determined according to the first interface information, and writing middleware code according to the first interface, and constructing the intermediate data according to the middleware code.
[0011] In an exemplary embodiment, after sending the first interface information to the target object, the method further includes: when it is determined that the target object has received the first interface information, obtaining sending information corresponding to the first interface information and identification information of the target object, wherein the sending information includes at least one of the following: a receiving department that receives the first interface information, a sending time of sending the first interface information, and a number of times the first interface information is sent; constructing visualization data corresponding to the first interface based on the sending information and the identification information; and monitoring the first interface based on the visualization data.
[0012] In an exemplary embodiment, constructing visualization data corresponding to the first interface based on the sending information and the identification information includes: determining whether the sending information and the identification information include sensitive data; in the case where it is determined that the sending information and the identification information include the sensitive data, obfuscating the sensitive data; updating the sending information and the identification information based on the obfuscated sensitive data; and constructing the visualization data based on the updated sending information and the updated identification information.
[0013] According to another embodiment of the embodiment of the present application, a device for constructing intermediate data is also provided, including: a first determination module, used to determine the permission information of the target object, wherein the permission information includes: the interface permission of the department where the target object is located; a second determination module, used to determine the first interface information based on the permission information, wherein the target object has the right to use the first interface corresponding to the first interface information; a sending module, used to send the first interface information to the target object, so that the target object constructs the intermediate data according to the first interface information.
[0014] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned intermediate data construction method when running.
[0015] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the intermediate data construction method through the computer program.
[0016] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, wherein the computer program is executed by a processor to implement the above-mentioned method for constructing intermediate data.
[0017] In an embodiment of the present application, the interface authority of the department where the target object is located is determined; the first interface information is determined according to the interface authority of the department where the target object is located, that is, the target object has the right to use the first interface corresponding to the first interface information; the first interface information is sent to the target object, so that the target object constructs intermediate data according to the first interface information. In other words, the embodiment of the present application filters the interface information by determining the interface authority of the department where the target object is located, and only sends the first interface information within the scope allowed by the interface authority to the target object, that is, members of the department where the target object is located are only allowed to use the first interface with interface authority, and cannot use all interfaces. Through the above method, the problem in the related technology that when it is necessary to build intermediate data through API, all APIs can be used in different development departments without authority restrictions, which may lead to the problem of API abuse, thereby avoiding API abuse. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0020] Figure 1 It is a hardware environment diagram of a method for constructing intermediate data in an embodiment of the present application;
[0021] Figure 2 is a flowchart of a method for constructing intermediate data according to an embodiment of the present application;
[0022] Figure 3 It is a flow chart of a method for constructing a cross-platform tool library for dynamic export of each platform and API call monitoring according to an optional embodiment of the present application;
[0023] Figure 4 is a structural block diagram of a device for constructing intermediate data according to an embodiment of the present application;
[0024] Figure 5 A structural block diagram of a construction module of a device for constructing intermediate data according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] According to one aspect of the embodiments of the present application, a method for constructing intermediate data is provided. The method for constructing intermediate data is widely used in smart home, smart home, smart home device ecology, smart house ecology and other whole-house intelligent digital control application scenarios. Optionally, Figure 1 Schematic diagram of the hardware environment of a method for constructing intermediate data in an embodiment of the present application. In this embodiment, the method for constructing intermediate data can be applied to a module in a home appliance. The module can be applied to Figure 1 In the hardware environment composed of the home appliance 102 and the server 104 shown in FIG. Figure 1 As shown, the server 104 is connected to the home appliance 102 via a network, and can be used to provide services (such as application services, etc.) for the node or the client installed on the node. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.
[0028] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The home appliance 102 may be but is not limited to smart air conditioners, smart range hoods, smart refrigerators, smart ovens, smart stoves, smart washing machines, smart water heaters, smart washing equipment, smart dishwashers, smart projection equipment, smart TVs, smart clothes hangers, smart curtains, smart audio and video, smart sockets, smart speakers, smart speakers, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart sweeping robots, smart window cleaning robots, smart mopping robots, smart air purification equipment, smart steamers, smart microwave ovens, smart kitchen treasures, smart purifiers, smart water dispensers, smart door locks, etc.
[0029] In this embodiment, a method for constructing intermediate data is provided, which is applied to the above module. Figure 2 : is a flowchart of a method for constructing intermediate data according to an embodiment of the present application, and the process includes the following steps:
[0030] Step S202, determining the authority information of the target object, wherein the authority information includes: the interface authority of the department where the target object is located;
[0031] It is understandable that the above interface permissions refer to which interfaces the department where the target object is located is allowed to apply for. For example: the target object is in department 1, and the target object wants to apply for permission to use interface 1. If, by obtaining the permission information of the target object, it is found that department 1 only has permission to use interface 2, then it is impossible to apply for permission to use interface 1 for the target object. If, by obtaining the permission information of the target object, it is found that department 1 has permission to use interface 1, then it is possible to apply for permission to use interface 1 for the target object.
[0032] Step S204, determining first interface information according to the permission information, wherein the target object has permission to use the first interface corresponding to the first interface information;
[0033] Step S206: sending the first interface information to the target object, so that the target object constructs intermediate data according to the first interface information.
[0034] It is understandable that the above intermediate data is determined according to the specific needs of the target object, and the intermediate data may include various types of tools, such as: code editor plug-ins, build tools, debugging tools, performance optimization tools, etc.
[0035] Through the above steps, the interface authority of the department where the target object is located is determined; the first interface information is determined according to the interface authority of the department where the target object is located, that is, the target object has the right to use the first interface corresponding to the first interface information; the first interface information is sent to the target object, so that the target object constructs intermediate data according to the first interface information. In other words, the embodiment of the present application screens the interface information by determining the interface authority of the department where the target object is located, and only sends the first interface information within the scope allowed by the interface authority to the target object, that is, members of the department where the target object is located are only allowed to use the first interface with interface authority, and cannot use all interfaces. Through the above method, the problem in the related art that when it is necessary to construct intermediate data through an interface, all interfaces can be used in different development departments without authority restrictions, which may lead to the problem of abuse of interfaces, thereby avoiding abuse of interfaces.
[0036] Optionally, determining the permission information of the target object in the above step S202 includes: acquiring identification information of the target object; and determining the permission information of the target object in a permission system according to the identification information.
[0037] It is understandable that the authority information of the target object can be determined based on the relevant information of the target object. The relevant information of the target object may include: identification information of the target object; by determining which department contains the identification information of the target object, the department to which the target object belongs can be determined. Then, the authority information of the department to which the target object belongs in the authority system can be determined.
[0038] Optionally, before determining the first interface information according to the permission information in the above step S204, the method also includes: constructing a script file according to the permission information; filtering a second interface list based on the script file, wherein the second interface list is applied to indicate that the second interface corresponds to the second interface information, and the target object does not have permission to use the second interface corresponding to the second interface information; filtering the second interface information in the target interface information according to the second interface list, wherein the target interface information is the interface information stored in the interface database.
[0039] It is understandable that before determining the first interface information according to the permission information, a script file can also be constructed according to the permission information, and then all the interface information in the database can be obtained according to the script file. The permission information is compared with all the interface information stored in the database, and the second interface information that the department of the target object has no permission to access is screened out and filtered.
[0040] Optionally, the above step S204 determines the first interface information according to the permission information, including: constructing a script file according to the permission information; filtering a first interface list based on the script file, wherein the first interface list is used to indicate the first interface; generating a declaration file, an interface file and an interface description file corresponding to the first interface according to the first interface list, wherein the first interface information includes at least: a declaration file, an interface file and the interface description file corresponding to the first interface.
[0041] It can be understood that by constructing a script file, filtering out the second interface information that the department where the target object is located has no access to, and after filtering, the first interface list can be filtered. The first interfaces in the first interface list are all interfaces that the department where the target object is located has access to, and then the declaration file, interface file and interface description file corresponding to the first interface are determined based on the first interface list.
[0042] The interface file corresponding to the first interface is an interface file containing an authority interface, which may include: interface name, request method, request parameters, return result and other information.
[0043] Among them, the corresponding declaration file can be written according to the data structure and type information defined in the interface file.
[0044] Among them, an interface description document (i.e., the interface description file of this application) can be written based on the authorized first interface list, and the function, parameters, return results, etc. of each interface can be described in detail. The interface description document may include content such as request method, request parameter examples, and return result examples.
[0045] Among them, sending the first interface information to the target object so that the target object constructs intermediate data according to the first interface information includes: sending the first interface information to the target object so that the first interface with usage authority is determined according to the first interface information, and writing middleware code according to the first interface, and constructing the intermediate data according to the middleware code.
[0046] It is understandable that after the first interface information is sent to the target object, the target object can apply for the first interface required to meet the needs of the target object, and then the needs of the target object can be met by using the first interface, that is, intermediate data is generated.
[0047] Optionally, after sending the first interface information to the target object in the above step S206, the method further includes: when it is determined that the target object has received the first interface information, obtaining sending information corresponding to the first interface information and identification information of the target object, wherein the sending information includes at least one of the following: a receiving department that receives the first interface information, a sending time of sending the first interface information, and a number of times the first interface information is sent; constructing visualization data corresponding to the first interface based on the sending information and the identification information; and monitoring the first interface based on the visualization data.
[0048] It can be understood that when the first interface information is sent to the target object and the target object has constructed intermediate data based on the first interface information, relevant information of the first interface information can be obtained, such as: the sending time of the first interface information, the number of times it is sent, the department to which it is sent, and other information, as well as the identification information of the target object requesting the first interface information, including the identification information of the department where the target object is located.
[0049] Then, the visualization data corresponding to the first interface is constructed through the above information to avoid the situation that as the plug-in tool library is used more and more, and the plug-in library provides more and more interfaces. According to the interface usage, data support is provided for the iterative development and optimization of the plug-in library to prevent the increase of interfaces.
[0050] Among them, constructing the visualization data corresponding to the first interface according to the sending information and the identification information includes: determining whether the sending information and the identification information include sensitive data; in the case of determining that the sending information and the identification information include the sensitive data, obfuscating the sensitive data; updating the sending information and the identification information according to the obfuscated sensitive data; and constructing the visualization data according to the updated sending information and the updated identification information.
[0051] Among them, the above-mentioned sending information and identification information may contain sensitive data, such as: the department identification of the target object's department and other related information. At this time, the sensitive data needs to be obfuscated. Obfuscation is a method of protecting sensitive data. By encrypting or replacing sensitive data, it makes it difficult to be interpreted without authorization. Specifically, sensitive data can be obfuscated in the following ways:
[0052] 1) Encryption: Use encryption algorithms to encrypt sensitive data, and only authorized users can decrypt and obtain the original data.
[0053] 2) Replacement: Randomly replace sensitive data with other symbols or numbers to make it unrecognizable.
[0054] 3) Desensitization: Desensitize sensitive data, such as partially hiding names and phone numbers.
[0055] 4) Disruption: Sensitive data is processed in a disordered manner, causing it to lose its original order and association.
[0056] 5) Hash algorithm: Use the hash algorithm to hash sensitive data and generate unique summary information, but the original data cannot be restored.
[0057] In order to better understand the process of the method for constructing the above intermediate data, the implementation method flow of the construction of the above intermediate data is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.
[0058] With the development of the Internet of Things and IoT APPs, H5 has the advantage of flexible and fast iteration under the hybrid development model. The intermediate plug-in layer responsible for information communication between the H5 side and the native side must not only undertake the task of smoothing the differences between different systems and different webviews; it must also support cross-platform capabilities and export customized API interfaces according to the different needs of each development department; it should also have the ability to count interface calls and distinguish the activity of different departments and products. The current intermediate plug-in layer has certain defects: 1) It does not distinguish between platforms and exposes all APIs in full, which leads to code redundancy. In addition, the current plug-in layer is used in different development departments without authority restrictions, which is easy to cause abuse; 2) There is no reasonable usage statistics for each API usage, and it is impossible to provide positive feedback for the iterative development of the plug-in layer, resulting in an increase in the number of plug-in layer APIs; 3) It is impossible to effectively constrain the business side to make reasonable demands on the plug-in layer API, which is easy to waste development resources, and it is necessary to cooperate with statistical data to evaluate the business side's needs.
[0059] In response to the above problems, an optional embodiment of the present application provides a method for building a cross-platform tool library for dynamic export and API call monitoring on each platform, that is, when building a plug-in tool library product, the API exposure of the built product is limited according to the platform and department permissions, and the API is repackaged to add department identification and call data statistics logic to facilitate statistical data to obtain positive and feedback suggestions for iterative optimization of the plug-in library.
[0060] Specifically, Figure 3 It is a flow chart of a method for constructing a cross-platform tool library for dynamic export of each platform and API call monitoring according to an optional embodiment of the present application, such as Figure 3 As shown:
[0061] Step S301, start building.
[0062] When the builder (ie, the target object of this application) builds the plug-in tool library product, the building program starts.
[0063] Step S302, obtaining authentication.
[0064] Carry the builder information to the permission system to request the API permission information and department ID of the builder's department and return it.
[0065] Step S303, construct a script.
[0066] The program script (i.e. the script file of this application) is constructed to filter out the API information without permission (i.e. the second interface information of this application) according to the department API permission information. And the authorized API interface file and its type declaration file (TypeScript Declaration File, referred to as ts declaration file) and interface description document (i.e. the declaration file, interface file and interface description file corresponding to the first interface of this application) are organized.
[0067] Step S304, obfuscating sensitive data.
[0068] Department identification and other sensitive data are obfuscated, and statistical data and logic are dynamically injected through scripts.
[0069] Step S305, completing the construction.
[0070] Generate intermediate data.
[0071] In the related technology, with the increasing use of plug-in tool libraries and the increasing number of API interfaces provided by plug-in libraries, the optional embodiment of the present application can effectively reduce the volume of plug-in library construction products and reduce redundant code by dynamically limiting and processing the constructed plug-in library products in cooperation with the permission system; at the same time, by dynamically injecting statistical data logic into the plug-in library interface, it is convenient to analyze the call status of each department for each API, and carefully evaluate the new requirements of each department for the API, optimize the use of development resources, and also facilitate the iterative development optimization of the plug-in library based on the API usage to provide data support to prevent the API from increasing instead of decreasing.
[0072] That is, the optional embodiments of the present application can cooperate with the permission system. When building, the API interface of the plug-in tool library can be dynamically filtered and integrated through scripts based on the acquired API permission information, and the exposure of the API can be limited. At the same time, statistical data information and logic can be dynamically imported through scripts, which is convenient for evaluating the calling business party based on the statistical information, and for positive iterative information feedback to the plug-in tool library.
[0073] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0074] Figure 4 is a structural block diagram of a device for constructing intermediate data according to an embodiment of the present application; Figure 4 As shown, including:
[0075] A first determination module 42 is used to determine the authority information of the target object, wherein the authority information includes: the interface authority of the department where the target object is located;
[0076] It is understandable that the above interface permissions refer to which interfaces the department where the target object is located is allowed to apply for. For example: the target object is in department 1, and the target object wants to apply for permission to use interface 1. If, by obtaining the permission information of the target object, it is found that department 1 only has permission to use interface 2, then it is impossible to apply for permission to use interface 1 for the target object. If, by obtaining the permission information of the target object, it is found that department 1 has permission to use interface 1, then it is possible to apply for permission to use interface 1 for the target object.
[0077] A second determining module 44 is used to determine first interface information according to the permission information, wherein the target object has permission to use the first interface corresponding to the first interface information;
[0078] The sending module 46 is used to send the first interface information to the target object, so that the target object constructs intermediate data according to the first interface information.
[0079] It is understandable that the above intermediate data is determined according to the specific needs of the target object, and the intermediate data may include various types of tools, such as: code editor plug-ins, build tools, debugging tools, performance optimization tools, etc.
[0080] Through the above-mentioned device, the interface authority of the department where the target object is located is determined; the first interface information is determined according to the interface authority of the department where the target object is located, that is, the target object has the right to use the first interface corresponding to the first interface information; the first interface information is sent to the target object, so that the target object constructs intermediate data according to the first interface information. In other words, the embodiment of the present application filters the interface information by determining the interface authority of the department where the target object is located, and only sends the first interface information within the scope allowed by the interface authority to the target object, that is, members of the department where the target object is located are only allowed to use the first interface with interface authority, and cannot use all interfaces. Through the above-mentioned method, the problem in the related technology that when it is necessary to construct intermediate data through API, all APIs can be used in different development departments without authority restrictions, which may lead to the problem of API abuse, thereby avoiding API abuse.
[0081] In an exemplary embodiment, the first determining module 42 is further configured to obtain identification information of the target object; and determine permission information of the target object in a permission system according to the identification information.
[0082] It is understandable that the authority information of the target object can be determined based on the relevant information of the target object. The relevant information of the target object may include: identification information of the target object; by determining which department contains the identification information of the target object, the department to which the target object belongs can be determined. Then, the authority information of the department to which the target object belongs in the authority system can be determined.
[0083] In an exemplary embodiment, the first determination module 42 is also used to construct a script file based on the permission information; filter a second interface list based on the script file, wherein the second interface list is used to indicate that the second interface corresponds to the second interface information, and the target object does not have permission to use the second interface corresponding to the second interface information; filter the second interface information in the target interface information according to the second interface list, wherein the target interface information is the interface information stored in the interface database.
[0084] It is understandable that before determining the first interface information according to the permission information, a script file can also be constructed according to the permission information, and then all the interface information in the database can be obtained according to the script file. The permission information is compared with all the interface information stored in the database, and the second interface information that the department of the target object has no permission to access is screened out and filtered.
[0085] In an exemplary embodiment, the second determination module 44 is also used to construct a script file based on the permission information; filter a first interface list based on the script file, wherein the first interface list is used to indicate the first interface; generate a declaration file, an interface file and an interface description file corresponding to the first interface according to the first interface list, wherein the first interface information includes at least: a declaration file, an interface file and the interface description file corresponding to the first interface.
[0086] It can be understood that by constructing a script file, filtering out the second interface information that the department where the target object is located has no access to, and after filtering, the first interface list can be filtered. The first interfaces in the first interface list are all interfaces that the department where the target object is located has access to, and then the declaration file, interface file and interface description file corresponding to the first interface are determined based on the first interface list.
[0087] The interface file corresponding to the first interface is an interface file containing an authority interface, which may include: interface name, request method, request parameters, return result and other information.
[0088] Among them, the corresponding declaration file can be written according to the data structure and type information defined in the interface file.
[0089] Among them, an interface description document (i.e., the interface description file of this application) can be written based on the authorized first interface list, and the function, parameters, return results, etc. of each interface can be described in detail. The interface description document may include content such as request method, request parameter examples, and return result examples.
[0090] In an exemplary embodiment, the second determination module 44 is further used to send the first interface information to the target object so as to determine the first interface with usage permission based on the first interface information, write middleware code based on the first interface, and construct the intermediate data based on the middleware code.
[0091] It is understandable that after the first interface information is sent to the target object, the target object can apply for the first interface required to meet the needs of the target object, and then the needs of the target object can be met by using the first interface, that is, intermediate data is generated.
[0092] In an exemplary embodiment, the apparatus further comprises: a building module, Figure 5 A structural block diagram of a construction module of a construction device for intermediate data according to an embodiment of the present application, such as Figure 5 As shown:
[0093] The construction module includes: a first construction submodule 52 and a second construction submodule 54, wherein:
[0094] The first construction submodule 52 is also used to obtain the sending information corresponding to the first interface information and the identification information of the target object when it is determined that the target object has received the first interface information, wherein the sending information includes at least one of the following: the receiving department that receives the first interface information, the sending time of sending the first interface information, and the number of times the first interface information is sent; construct visual data corresponding to the first interface according to the sending information and the identification information; and monitor the first interface according to the visual data.
[0095] It can be understood that when the first interface information is sent to the target object and the target object has constructed intermediate data based on the first interface information, relevant information of the first interface information can be obtained, such as: the sending time of the first interface information, the number of times it is sent, the department to which it is sent, and other information, as well as the identification information of the target object requesting the first interface information, including the identification information of the department where the target object is located.
[0096] Then, the visualization data corresponding to the first interface is constructed through the above information to avoid the situation that as the plug-in tool library is used more and more, and the plug-in library provides more and more interfaces. According to the interface usage, data support is provided for the iterative development and optimization of the plug-in library to prevent the increase of interfaces.
[0097] The second construction submodule 54 is also used to determine whether the sending information and the identification information include sensitive data; when it is determined that the sending information and the identification information include the sensitive data, obfuscate the sensitive data; update the sending information and the identification information according to the obfuscated sensitive data; and construct the visualization data according to the updated sending information and the updated identification information.
[0098] Among them, the above-mentioned sending information and identification information may contain sensitive data, such as: the department identification of the target object's department and other related information. At this time, the sensitive data needs to be obfuscated. Obfuscation is a method of protecting sensitive data. By encrypting or replacing sensitive data, it makes it difficult to be interpreted without authorization. Specifically, sensitive data can be obfuscated in the following ways:
[0099] 1) Encryption: Use encryption algorithms to encrypt sensitive data, and only authorized users can decrypt and obtain the original data.
[0100] 2) Replacement: Randomly replace sensitive data with other symbols or numbers to make it unrecognizable.
[0101] 3) Desensitization: Desensitize sensitive data, such as partially hiding names and phone numbers.
[0102] 4) Disruption: Sensitive data is processed in a disordered manner, causing it to lose its original order and association.
[0103] 5) Hash algorithm: Use the hash algorithm to hash sensitive data and generate unique summary information, but the original data cannot be restored.
[0104] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.
[0105] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:
[0106] S1, determining the authority information of the target object, wherein the authority information includes: the interface authority of the department where the target object is located;
[0107] S2, determining first interface information according to the permission information, wherein the target object has permission to use the first interface corresponding to the first interface information;
[0108] S3: Send the first interface information to the target object, so that the target object constructs intermediate data according to the first interface information.
[0109] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0110] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0111] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0112] S1, determining the authority information of the target object, wherein the authority information includes: the interface authority of the department where the target object is located;
[0113] S2, determining first interface information according to the permission information, wherein the target object has permission to use the first interface corresponding to the first interface information;
[0114] S3: Send the first interface information to the target object, so that the target object constructs intermediate data according to the first interface information.
[0115] An embodiment of the present application further provides a computer program product, including a computer program, which is used by a processor to execute the steps in any of the above method embodiments.
[0116] Optionally, in this embodiment, the computer program product may be executed by a processor to perform the following steps:
[0117] S1, determining the authority information of the target object, wherein the authority information includes: the interface authority of the department where the target object is located;
[0118] S2, determining first interface information according to the permission information, wherein the target object has permission to use the first interface corresponding to the first interface information;
[0119] S3: Send the first interface information to the target object, so that the target object constructs intermediate data according to the first interface information.
[0120] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0121] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0122] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0123] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for constructing intermediate data, characterized in that: include: Determine the authority information of the target object, wherein the authority information includes: the interface authority of the department where the target object is located; Determine first interface information according to the permission information, wherein the target object has permission to use the first interface corresponding to the first interface information; The first interface information is sent to the target object, so that the target object constructs intermediate data according to the first interface information.
2. The method for constructing intermediate data according to claim 1, characterized in that: Determine the target object's permission information, including: Obtaining identification information of the target object; The permission information of the target object is determined in the permission system according to the identification information.
3. The method for constructing intermediate data according to claim 1, characterized in that: Before determining the first interface information according to the authority information, the method further includes: Constructing a script file according to the permission information; Filtering the second interface list based on the script file, wherein the second interface list is applied to indicate the second interface corresponding to the second interface information, and the target object does not have permission to use the second interface corresponding to the second interface information; The second interface information in the target interface information is filtered according to the second interface list, wherein the target interface information is the interface information stored in the interface database.
4. The method for constructing intermediate data according to claim 1, characterized in that: Determining first interface information according to the authority information includes: Constructing a script file according to the permission information; Filtering a first interface list based on the script file, wherein the first interface list is used to indicate the first interface; A declaration file, an interface file and an interface description file corresponding to the first interface are generated according to the first interface list, wherein the first interface information at least includes: a declaration file, an interface file and the interface description file corresponding to the first interface.
5. The method for constructing intermediate data according to claim 4, characterized in that: Sending the first interface information to the target object so that the target object constructs intermediate data according to the first interface information includes: The first interface information is sent to the target object, so that the first interface with usage permission is determined according to the first interface information, middleware code is written according to the first interface, and the intermediate data is constructed according to the middleware code.
6. The method for constructing intermediate data according to claim 1, characterized in that: After sending the first interface information to the target object, the method further includes: In the case where it is determined that the target object has received the first interface information, acquiring sending information corresponding to the first interface information and identification information of the target object, wherein the sending information includes at least one of the following: a receiving department that receives the first interface information, a sending time when the first interface information is sent, and a sending number of times the first interface information is sent; Construct visualization data corresponding to the first interface according to the sending information and the identification information; and monitor the first interface according to the visualization data.
7. The method for constructing intermediate data according to claim 6, characterized in that: Constructing visual data corresponding to the first interface according to the sending information and the identification information, including: Determining whether the sent information and the identification information include sensitive data; In the case where it is determined that the sending information and the identification information include the sensitive data, obfuscating the sensitive data; Update the sending information and the identification information according to the obfuscated sensitive data; The visualization data is constructed according to the updated sending information and the updated identification information.
8. A device for constructing intermediate data, characterized in that: include: A first determination module is used to determine the authority information of the target object, wherein the authority information includes: the interface authority of the department where the target object is located; A second determining module, configured to determine first interface information according to the permission information, wherein the target object has permission to use the first interface corresponding to the first interface information; A sending module is used to send the first interface information to the target object, so that the target object constructs intermediate data according to the first interface information.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 7 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.
Citation Information
Patent Citations
Interface permission control method and device, storage medium and electronic equipment
CN118171297A