Universal read service platform and method for reading data
By designing a general reading service platform, using the interface configuration center, parsing processor and cache processor, the decoupling and cross-domain solution of read services and write services is achieved, and the high workload and cross-domain problems caused by the splitting of read services and write services in existing e-commerce systems is solved, and the system performance and expansion capabilities are improved.
Patent Information
- Application Number
- CN202311571405.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-23
- Publication Date
- 2025-05-23
AI Technical Summary
In the existing e-commerce system, read services and write services need to be split into two functional modules, which leads to large transformation workload and high communication costs. Different read services have different domain names, which leads to difficulty in front-end calling and requires solving cross-domain problems.
A general reading service platform is designed, including an interface configuration center, a parsing processor and a cache processor. It obtains data from the write service through generalized calls, and stores and manages data in the cache, and provides a reading service interface to solve cross-domain problems.
It realizes the decoupling of read services and write services, reduces the transformation workload and communication costs, and the unified domain name solves cross-domain problems and improves the system's expansion capabilities and performance.
Smart Images

Figure CN120034418A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular to a universal reading service platform and a method for reading data. Background Art
[0002] In today's e-commerce scenarios, in order to improve system performance and scalability, microservices are usually used to build a complete business function. A complete business function will be divided into two sub-business functions: read and write. The write service is used to configure data into the distributed cache, and the read service is used to obtain data from the distributed cache to provide high-performance data query capabilities and complete protocol conversion. For example, the product business line is divided into product read service and product write service, and the store business line is divided into store read service and store write service.
[0003] Although the above solution can achieve the function, it will have the following disadvantages:
[0004] 1. Basically, each business needs to be split into two functional modules: read and write. The transformation of one requires the simultaneous transformation of the other, which causes a lot of workload.
[0005] 2. In order to decouple, it is usually deployed into two clusters and maintained by two teams. In this case, the communication cost is also very high.
[0006] 3. Different read services have different domain names, and the front end cannot call them arbitrarily. If you need to use multiple read service interface data, you need to solve the cross-domain problem. Summary of the invention
[0007] Embodiments of the present disclosure provide a method and device for reading data.
[0008] In the first aspect, an embodiment of the present disclosure provides a universal read service platform, including: an interface configuration center, configured to receive interface information of a write service, and generate an external protocol link and a parameter template according to the interface information, wherein the parameter template is used to represent the mapping relationship between input parameters and entity classes; a parsing processor, configured to disassemble the external application request interface from the application layer into various parameters according to the generation rules of the external protocol link, obtain the parameter template from the interface configuration center, parse the parameter template, and obtain the class name and method corresponding to each parameter; a cache processor, configured to obtain data from the write service through a generalized call according to the class name and method.
[0009] In some embodiments, the platform further includes: a monitoring center configured to record logs of the interface configuration center, the parsing processor, and the cache processor.
[0010] In some embodiments, the monitoring center is further configured to: monitor the log and issue an alarm if an abnormality is found.
[0011] In some embodiments, the interface information includes a cache strategy and a cache identifier; and the cache processor is further configured to: if the cache strategy is active cache or passive cache, obtain a cache identifier; obtain data from the cache according to the cache identifier; if the data is obtained successfully, directly return the data to the application layer.
[0012] In some embodiments, the cache processor is further configured to: if data acquisition fails, obtain data from the write service through a generalized call according to the class name and method; write the obtained data into the cache and set the cache expiration time; obtain data from the cache according to the cache identifier and return it to the application layer.
[0013] In some embodiments, the cache processor is further configured to: if the cache strategy is passive cache, build a cache when the data to be read by the external application request interface cannot be found in the cache.
[0014] In some embodiments, the cache processor is further configured to: if the cache strategy is active caching, rebuild the cache when the cache creation time is greater than the refresh time.
[0015] In a second aspect, an embodiment of the present disclosure provides a method for reading data, comprising: receiving interface information of a write service, generating an external protocol link and a parameter template according to the interface information, wherein the parameter template is used to represent the mapping relationship between input parameters and entity classes; decomposing the external application request interface from the application layer into various parameters according to the generation rules of the external protocol link, obtaining the parameter template from the interface configuration center, parsing the parameter template to obtain the class name and method corresponding to each parameter; and obtaining data from the write service through a generalized call according to the class name and method.
[0016] In some embodiments, the method further includes: recording logs of the interface configuration center, the parsing processor, and the cache processor.
[0017] In some embodiments, the method further includes: monitoring the log and issuing an alarm if an abnormality is found.
[0018] In some embodiments, the interface information includes a cache strategy and a cache identifier; and the method further includes: if the cache strategy is active cache or passive cache, obtaining a cache identifier; obtaining data from the cache according to the cache identifier; if the data is obtained successfully, directly returning the data to the application layer.
[0019] In some embodiments, the method further includes: if data acquisition fails, obtaining data from the write service through a generalized call according to the class name and method; writing the obtained data into the cache and setting a cache expiration time; obtaining data from the cache according to the cache identifier and returning it to the application layer.
[0020] In some embodiments, the method further includes: if the cache strategy is passive cache, building a cache when the data to be read by the external application request interface cannot be found in the cache.
[0021] In some embodiments, the method further includes: if the cache strategy is active cache, rebuilding the cache when the cache creation time is greater than the refresh time.
[0022] In a third aspect, an embodiment of the present disclosure provides an electronic device for reading data, comprising: one or more processors; a storage device on which one or more computer programs are stored, and when the one or more computer programs are executed by the one or more processors, the one or more processors implement the method described in the second aspect.
[0023] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method described in the second aspect.
[0024] The embodiments of the present disclosure have built a universal read service platform, which supports the basic capabilities of read services, which is equivalent to integrating the read services of various business lines. It supports the ability of developers to implement the functional effects required by their respective businesses by configuring read service information, solving the problem that the transformation of one party requires the simultaneous transformation of the other party. At the same time, this also enables the same group of developers to maintain the read and write service effects, and there is no problem of two teams needing to communicate. In addition, because this read service platform uses the same domain name, it solves the cross-domain problem of front-end aggregation of multiple read service interface data.
[0025] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Other features, objects and advantages of the present disclosure will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0027] Figure 1 is a system architecture diagram of the universal reading service platform disclosed in the present invention;
[0028] Figure 2is a flow chart of an embodiment of a method for reading data according to the present disclosure;
[0029] Figure 3 is a flow chart of another embodiment of a method for reading data according to the present disclosure;
[0030] Figure 4 is a schematic diagram of an application scenario of the method for reading data according to the present disclosure;
[0031] Figure 5 It is a structural diagram of a computer system of an electronic device suitable for implementing an embodiment of the present disclosure. DETAILED DESCRIPTION
[0032] The present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.
[0033] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0034] Figure 1 The system architecture diagram of the read-write service platform is shown.
[0035] like Figure 1 As shown, the system includes a general read service platform, write services for each business line, and an application layer. Among them, the general read service platform includes a basic service layer and a basic data layer. The basic service layer is divided into two modules, one is the interface configuration center, and the other is the read service engine center. Among them, the read service engine center is further divided into a parsing processor, a cache processor, a monitoring center, etc. The basic data layer includes a Redis cluster (cache) and a MySql cluster (database). Redis can be replaced by oracle, and mysql can also be replaced by oracle. It can also be replaced with other types of databases, which are not limited here.
[0036] Each business line write service registers the interface information of the write service in the interface configuration center, that is, maps each interface of the write service with the general protocol interface to obtain a parameter template, and each interface of the write service uses a unified domain name to the outside. The user initiates a request to read data to the general read service platform through the application layer. After parsing the request, various parameters are obtained, and then the class name and method corresponding to each interface are obtained by parsing the parameter template. Then, data is obtained from the write service using a generalized call method.
[0037] Optionally, the data of the write service is also stored in the cache first, and the general read service platform reads the data directly from the cache.
[0038] Optionally, the data of the interface configuration center may be stored in a database, such as a MySql cluster.
[0039] In this embodiment, the universal read service platform includes: an interface configuration center, which is configured to receive interface information of a write service, and generate an external protocol link and a parameter template according to the interface information, wherein the parameter template is used to represent the mapping relationship between input parameters and entity classes; a parsing processor, which is configured to disassemble the external application request interface from the application layer into various parameters according to the generation rules of the external protocol link, obtain the parameter template from the interface configuration center, parse the parameter template, and obtain the class name and method corresponding to each parameter; a cache processor, which is configured to obtain data from the write service through a generalized call according to the class name and method.
[0040] The interface configuration center mainly inputs the interface information of the write service into the configuration center, including: bizLine business line for business classification, url configuration interface address for generalized call, alias alias for rpc call grouping, urlType interface type for identifying http / rpc, method method name to call the interface, timeout identifies the timeout period, cacheStrategy cache strategy for identifying whether the cache strategy is enabled and the cache type, inputs parameter object for identifying the parameter configuration of the method, inputsTemplate parameter type definition template for parameter generalization, etc. After the above data is configured, it is stored in the Mysql data table.
[0041] It also generates external protocol links, and the generated specifications are:
[0042] outUrl: domain name + bizLine + url + method + inputs parameters, used to expose to external applications. The universal read service platform uses one domain name, and different write service interfaces ultimately have unified external domain names, solving the cross-domain problem of front-end aggregation of multiple read service interface data.
[0043] The interface information may be converted into a parameter template through DSL (Dynamic Script Language), wherein the parameter template is used to represent a mapping relationship between input parameters and entity classes.
[0044] The generated parameter template may include at least one of the following information:
[0045] 1. Business lines: such as product lines and store lines
[0046] 2. Published remote service address
[0047] 3. RPC alias
[0048] 4. Interface type: http or rpc
[0049] 5. The method name of the interface to be called
[0050] 6. Timeout
[0051] 7. Cache strategy
[0052] 8. Cache type: None & Active & Passive
[0053] 9. Invalid time
[0054] 10. Refresh time
[0055] 11. Cache ID: "domain name + bizLine + url + method + inputs parameters", / / cache ID
[0056] 12. Input parameter information: Multiple input parameters are written in the key:value structure and used in conjunction with inputsTemplate
[0057] 13. Category definition and type definition template for input key
[0058] 14. External interface specifications
[0059] The read service engine center is divided into a parsing processor and a cache processor, which are mainly used to cache the data according to the cache strategy in the write service data execution configuration, and then convert the request protocol into the http protocol through service generalization technology, and provide it to external applications for use, while supporting corresponding alarm monitoring.
[0060] The parsing processor first disassembles the external application request interface into various parameters according to the corresponding specifications (domain name + bizLine + url + method + inputs parameters), then pulls the configuration center data according to the above parameters, obtains the corresponding configuration DSL information (i.e. parameter template), and then parses the DSL information to obtain the corresponding url, urlType, alias, and method. Then, it obtains data through generalized calls to complete the protocol conversion.
[0061] Generic call means: through generic call, the client can call the service without the service provider providing an interface protocol and without relying on the service provider's API, and handle all service requests through an interface like GenericService.
[0062] When querying data, the cache processor first obtains the cacheStrategy cache strategy in the DSL, determines the cacheType, and selects the cache model:
[0063] If no cache strategy is configured, that is, a no-cache model, service generalization is used directly to obtain data. The specific ideas are as follows:
[0064] Encapsulates the GenericService interface class, and can use dobble and other methods to implement data interaction of the underlying data.
[0065] The encapsulation process of the GenericService interface class may include: declaring a generalized unified interface, parsing parameters carried on the request link, parsing the url and method from the DSL and concatenating them, and setting parameters.
[0066] In some optional implementations of this embodiment, the interface information includes a cache strategy and a cache identifier; and the cache processor is further configured to: if the cache strategy is active cache or passive cache, obtain a cache identifier; obtain data from the cache according to the cache identifier; if the data is successfully obtained, directly return the data to the application layer.
[0067] If the cache strategy has been configured, that is, the active or passive cache model, directly obtain the cacheKey (cache identifier) under cacheStrategy.
[0068] If the data is retrieved successfully, the data is returned directly, which is a cache hit.
[0069] In some optional implementations of this embodiment, the cache processor is further configured to: if data acquisition fails, obtain data from the write service through a generalized call according to the class name and method; write the obtained data into the cache and set the cache expiration time; obtain data from the cache according to the cache identifier and return it to the application layer.
[0070] If the data is not obtained successfully, the service generalization is triggered to obtain the data of the corresponding write service, and then the data is written into the cache and the cache expiration time is set.
[0071] Note: The generalization method is the same as above.
[0072] In some optional implementations of this embodiment, the cache processor is further configured to: if the cache strategy is passive cache, build a cache when the data to be read by the external application request interface cannot be found in the cache.
[0073] Use the timing + lazy strategy to scan the global configuration center data and determine the cache type cacheType under cacheStrategy.
[0074] If cacheType is empty, there is no cache strategy and no operation is performed.
[0075] If cacheType is passive, a passive strategy is adopted. Data construction is performed only when the interface request cannot find data in the cache. The corresponding cache is built for the interface request and marked with the cache identifier in the parameter template. The data of the write service is stored in the built cache. When the read service reads the data, it is read directly from the cache without interacting with the write service.
[0076] In some optional implementations of this embodiment, the cache processor is further configured to: if the cache strategy is active cache, rebuild the cache when the cache creation time is greater than the refresh time.
[0077] If cacheType is active, the active strategy is adopted, and it is necessary to determine whether the current time - refreshTime (refresh time) is less than the cache creation time. If it is less than, the cache is rebuilt. Even if there is no read service to read the data, the data in the cache will be updated according to the schedule. If the data in the cache has not been updated for a long time, it will actively obtain the data from the write service and write it into the cache for cache reconstruction.
[0078] In some optional implementations of this embodiment, the platform further includes: a monitoring center configured to record logs of the interface configuration center, the parsing processor, and the cache processor. The logs may record information related to reading / retrieving data, such as data source, write time, read time, cache identifier, etc.
[0079] In some optional implementations of this embodiment, the monitoring center is further configured to: monitor the logs and issue an alarm if an abnormality is found. Key log records are added to each of the above process nodes. If an abnormality is found, an alarm is issued, and the levels are divided into info, warn, error, etc. from low to high. Abnormal email alarms can be added, or mature alarm systems such as ump (unified security management platform) can be directly connected. Alarm monitoring panels can be added, or mature alarm panels such as ump can be connected.
[0080] This solution uses the idea of service generalization and configuration to implement a universal read service platform, which can provide unified read service support for write services of multiple business lines. The specific advantages are as follows: Based on the unified read service platform with configuration, it can avoid the problem of synchronous transformation of write services and read services, while saving communication costs. Providing a unified read service platform, which is maintained by the same service cluster, saves server costs. Using the configuration idea, the cache type (no cache / active cache / passive cache), cache time, refresh time, etc. of the interface in the write service can be flexibly controlled. Service support is provided by a unified read service platform, so that all interfaces have the same domain name, avoiding the need to solve cross-domain problems.
[0081] Continue to refer Figure 2, shows a process 200 of an embodiment of a method for reading data according to the present disclosure. The method for reading data comprises the following steps:
[0082] Step 201, receiving interface information of a write service, and generating an external protocol link and a parameter template according to the interface information.
[0083] In this embodiment, the execution subject of the method for reading data (for example Figure 1 The interface configuration center of the universal read service platform shown in the figure can receive interface information from the write service through a wired connection or a wireless connection. The interface configuration center mainly inputs the interface information of the write service into the configuration center, including: bizLine business line for business classification, url configuration interface address for generalized call, alias alias for rpc call grouping, urlType interface type for identifying http / rpc, method method name to call the interface, timeout identification timeout, cacheStrategy cache strategy for identifying whether the cache strategy is enabled and the cache type, inputs parameter object for identifying the parameter configuration of the method, inputsTemplate parameter type definition template for parameter generalization, etc. After the above data is configured, it is stored in the Mysql data table.
[0084] It also generates external protocol links, and the generated specifications are:
[0085] outUrl: domain name + bizLine + url + method + inputs parameters, used to expose to external applications. The universal read service platform uses one domain name, and different write service interfaces ultimately have unified external domain names, solving the cross-domain problem of front-end aggregation of multiple read service interface data.
[0086] The interface information can be converted into a parameter template through DSL (Dynamic Script Language), wherein the parameter template is used to represent the mapping relationship between the input parameter and the entity class. The specific example is as described above.
[0087] Step 202: The external application request interface from the application layer is disassembled into various parameters according to the generation rules of the external protocol link.
[0088] In this embodiment, the external application request interface is disassembled into various parameters according to the corresponding specifications (domain name+bizLine+url+method+inputs parameters).
[0089] Step 203: Obtain a parameter template from the interface configuration center, and parse the parameter template to obtain the class name and method corresponding to each parameter.
[0090] In this embodiment, the configuration center data is pulled according to the above parameters to obtain the corresponding configuration DSL information (ie, parameter template), and then the DSL information is parsed to obtain the corresponding url, urlType, alias, and method.
[0091] Step 204: Obtain data from the write service by generalized calling according to the class name and method.
[0092] In this embodiment, service generalization is directly used to obtain data. The specific ideas are as follows:
[0093] Encapsulates the GenericService interface class, and can use dobble and other methods to implement underlying data interaction.
[0094] The encapsulation process of the GenericService interface class may include: declaring a generalized unified interface, parsing parameters carried on the request link, parsing the url and method from the DSL and concatenating them, and setting parameters.
[0095] Further references Figure 3 , which shows a process 300 of another embodiment of a method for reading data. The process 300 of the method for reading data includes the following steps:
[0096] Step 301, receiving interface information of a write service, and generating an external protocol link and a parameter template according to the interface information.
[0097] Step 302: The external application request interface from the application layer is disassembled into various parameters according to the generation rules of the external protocol link.
[0098] Step 303: Obtain a parameter template from the interface configuration center, and parse the parameter template to obtain the class name and method corresponding to each parameter.
[0099] Steps 301-303 are substantially the same as steps 201-203, and thus are not described in detail herein.
[0100] Step 304: If the cache strategy is active cache or passive cache, a cache identifier is obtained, and data is obtained from the cache according to the cache identifier.
[0101] In this embodiment, if the cache strategy has been configured, that is, the active or passive cache model, the cacheKey (cache identifier) under the cacheStrategy is directly obtained.
[0102] Step 305: If the data is acquired successfully, the data is directly returned to the application layer.
[0103] In this embodiment, if the data is acquired successfully, the data is directly returned, which is a cache hit.
[0104] Step 306: If data acquisition fails, data is acquired from the write service by generalized calling according to the class name and method.
[0105] In this embodiment, if the data is not successfully obtained, the service generalization is triggered to obtain the data of the corresponding write service, and then the data is written into the cache and the cache expiration time is set.
[0106] from Figure 3 It can be seen that Figure 2 Compared with the corresponding embodiment, the process 300 of the method for reading data in this embodiment embodies the steps of caching the data of the write service. Therefore, the solution described in this embodiment can adopt the configuration idea to flexibly control the cache type (no cache / active cache / passive cache), cache time, refresh time, etc. of the interface in the write service.
[0107] In some optional implementations of this embodiment, the method further includes: recording logs of the interface configuration center, the parsing processor, and the cache processor.
[0108] In some optional implementations of this embodiment, the method further includes: monitoring the log and issuing an alarm if an abnormality is found.
[0109] In some optional implementations of this embodiment, the method further includes: if the cache strategy is passive cache, building a cache when the data to be read by the external application request interface cannot be found in the cache.
[0110] In some optional implementations of this embodiment, the method further includes: if the cache strategy is active cache, rebuilding the cache when the cache creation time is greater than the refresh time.
[0111] Continue to see Figure 4 , Figure 4 FIG. 1 is a schematic diagram of an application scenario of the method for reading data according to this embodiment. Figure 4 In the application scenario, the write service first registers the interface information in the interface configuration center. The interface configuration center generates external protocol links and parameter templates based on the interface information. The write service stores the data in the cache and uses the cache identifier to mark the data source. The user accesses the universal read service platform through the software of the application layer and calls the external application request interface. The universal read service platform parses the external application request interface, compares the parsed parameters with the parameter template, and converts them into class names and methods. Query data in the cache based on the parsed cache identifier. If the query in the cache fails, the data is obtained from the write service through a generalized call based on the class name and method.
[0112] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.
[0113] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.
[0114] An electronic device comprises: one or more processors; a storage device on which one or more computer programs are stored, and when the one or more computer programs are executed by the one or more processors, the one or more processors implement the method described in process 200 or 300.
[0115] A computer-readable medium stores a computer program, wherein the computer program implements the method described in process 200 or 300 when executed by a processor.
[0116] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0117] like Figure 5 As shown, the device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0118] A number of components in the device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0119] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as a method for reading data. For example, in some embodiments, the method for reading data may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of the method for reading data described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform a method for reading data in any other appropriate manner (e.g., by means of firmware).
[0120] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0121] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0122] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 foregoing.
[0123] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0124] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0125] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the respective computers and having a client-server relationship with each other. The server may be a server of a distributed system, or a server combined with a blockchain. The server may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. The server may be a server of a distributed system, or a server combined with a blockchain. The server may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.
[0126] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0127] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A universal read service platform, include: An interface configuration center is configured to receive interface information of a write service, and generate an external protocol link and a parameter template according to the interface information, wherein the parameter template is used to represent a mapping relationship between input parameters and entity classes; A parsing processor is configured to disassemble the external application request interface from the application layer into various parameters according to the generation rule of the external protocol link, obtain the parameter template from the interface configuration center, parse the parameter template, and obtain the class name and method corresponding to each parameter; The cache processor is configured to obtain data from the write service by generalized calling according to the class name and method.
2. The platform according to claim 1, in, The platform also includes: The monitoring center is configured to record the logs of the interface configuration center, the parsing processor, and the cache processor.
3. The platform according to claim 2, in, The monitoring center is further configured to: The log is monitored and an alarm is issued if an abnormality is found.
4. The platform according to claim 1, in, The interface information includes a cache strategy and a cache identifier; and The cache processor is further configured to: If the cache strategy is active cache or passive cache, obtain the cache identifier; Obtaining data from the cache according to the cache identifier; If the data is acquired successfully, the data is returned directly to the application layer.
5. The platform according to claim 4, in, The cache handler is further configured to: If data acquisition fails, data is acquired from the write service by generalized calling according to the class name and method; Write the acquired data into the cache and set the cache expiration time; The data is obtained from the cache according to the cache identifier and returned to the application layer.
6. The platform according to claim 4, in, The cache handler is further configured to: If the cache strategy is passive caching, the cache is built when the data to be read by the external application request interface cannot be found in the cache.
7. The platform according to claim 4, in, The cache handler is further configured to: If the cache strategy is aggressive caching, the cache is rebuilt when the cache creation time is greater than the refresh time.
8. A method for reading data, include: Receive interface information of a write service, and generate an external protocol link and a parameter template according to the interface information, wherein the parameter template is used to represent a mapping relationship between input parameters and entity classes; Decomposing the external application request interface from the application layer into various parameters according to the generation rule of the external protocol link; Obtain the parameter template from the interface configuration center, and parse the parameter template to obtain the class name and method corresponding to each parameter; The data is obtained from the write service by means of a generalized call according to the class name and method.
9. An electronic device for reading data, include: one or more processors; a storage device having one or more computer programs stored thereon, When the one or more computer programs are executed by the one or more processors, the one or more processors implement the method according to claim 8.
10. A computer readable medium having a computer program stored thereon, in, When the computer program is executed by a processor, the method according to claim 8 is implemented.
Citation Information
Cited By
Cache grouping method and device based on call stack, storage medium and related equipment
CN120541109A