Interface request method, device, equipment and computer-readable storage medium
By detecting interface changes and reasonably managing interface requests, the system crash problem caused by too many interface requests when entering the APP homepage is solved, and the effect of reducing server pressure and ensuring business fluency is achieved. It is suitable for complex scenarios and high concurrency environments.
Patent Information
- Application Number
- CN202010241234.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-30
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2040-03-30
AI Technical Summary
In the prior art, the system is prone to crash due to excessive interface requests during the APP homepage entry process, and the existing processing methods of downgrading or merging interfaces are not applicable to all scenarios, which affects business processes.
By sending a detection message when the target page is triggered to detect the changes in the interface, and determining whether to obtain interface configuration information from the server or locally based on the changes, reducing unnecessary interface requests, and using a combination of lightweight and heavyweight interfaces , cache data to reduce traffic and resource consumption.
It effectively reduces the pressure on the backend server, avoids system crashes, and ensures the normal operation of business functions, has a wide range of applications, is suitable for high concurrency scenarios, and achieves a win-win situation in performance improvement and business needs.
Smart Images

Figure CN111538889B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of interface request, and in particular to an interface request method, apparatus, device and computer-readable storage medium. Background Art
[0002] With the development of electronic technology and mobile Internet, the functions of smart mobile terminals are becoming more and more powerful. As long as users install various mobile applications (mobile APPs) on smart mobile terminals according to their own needs, they can get a lot of consulting information and even complete many things without leaving home. People's lives are becoming more and more inseparable from smart mobile terminals.
[0003] At present, most APPs are becoming more and more complex, especially the homepage, which has many operation scenarios and complex business. The interaction between APP and the backend server is also complex, resulting in more and more interface requests to be sent to enter the homepage after startup. For example, during an event, the surge in the number of users will lead to a sharp increase in the number of requests at the same time, which will undoubtedly bring huge pressure to the backend server and even cause the system to crash.
[0004] In response to the above technical problems, most solutions in the existing technology adopt the processing method of downgrading interfaces or merging and reducing interfaces, but downgrading interfaces will inevitably affect the normal process of the business, and merging and reducing interfaces is not applicable to every scenario, and some complex scenarios cannot be merged. Summary of the invention
[0005] The embodiments of the present application provide an interface request method, apparatus, device and computer-readable storage medium, which can not only solve the problem in the prior art that the system is prone to crash due to too many requested interfaces during the process of entering a page, but also ensure that business functions are normal and not affected, and have a wide range of applications.
[0006] In a first aspect, an embodiment of the present application provides an interface request method, including:
[0007] In the process of triggering the display of the target page, a detection message is sent to the server; the detection message is used to detect changes in the interface;
[0008] receiving a probe response message returned by the server; the probe response message indicates whether the configuration information corresponding to the interface has changed;
[0009] For the interface that has changed, request the server to call the interface that has changed, and obtain the configuration information corresponding to the interface that has changed; for the interface that has not changed, obtain the configuration information corresponding to the interface that has not changed from the local;
[0010] The target page is displayed according to the acquired configuration information.
[0011] By implementing the embodiments of the present application, by sending a detection message to inquire about the changes in the interface, there is no need to initiate a request call to the server for the interface that has not changed. For an APP with too many configuration information interfaces on the target page to be entered (such as the homepage), when the configuration changes are small, a lot of interface requests will be saved, reducing the pressure on the background server. That is, the problem of the system being prone to crash due to too many request interfaces in the process of entering the page in the prior art is solved, and the business functions can be guaranteed to be normal and unaffected, and it has a wide range of applications.
[0012] In one possible implementation, the method further includes:
[0013] When a new interface is added to the target page, the new interface is registered in the detection system through the registration system, and the version information of the registered interface is recorded in the storage system.
[0014] In one possible implementation manner, sending a detection message to the server includes:
[0015] Acquiring interface version information of a registered interface from the storage system through the detection system;
[0016] A detection message carrying the interface version information is sent to the server through the detection system.
[0017] In one possible implementation, the detection response message is generated by the server judging whether the configuration information corresponding to the interface has changed according to the received interface version information;
[0018] After receiving the detection response message returned by the server, the method further includes: for the changed interface, synchronously updating the interface version information of the changed interface to the storage system through the detection system.
[0019] Through the embodiment of the present application, the client can include three parts, a detection system, a registration system, and a storage system. The three parts can form a client probe system, which can further quickly and effectively solve the problem of the system crashing easily due to too many request interfaces in the process of entering the page in the prior art by rationally dividing the work of the three parts and directly and efficiently cooperating with each other to complete the client's interface request.
[0020] In one possible implementation, when the interfaces detected by the detection message include a first interface, and the configuration information corresponding to the first interface changes; the detection response message includes the configuration information corresponding to the first interface after the change; and the first interface is an interface of a first magnitude type.
[0021] Based on the interface request scheme of the embodiment of the present application, the detection heartbeat mechanism of the client and the server can be used to solve the problem of fast and timely update and synchronization of data in the absence of a long connection mechanism to a certain extent. At the same time, a combination of the first order type (such as lightweight) interface and the second order type (such as heavyweight) interface is adopted. For lightweight interfaces, when the data (equivalent to configuration information) changes, the interface version of the corresponding interface can be left unchanged, but the data of the interface is directly cached in a centralized cache. When the probe requests, the server directly returns the data, directly avoiding the client from making a secondary request, further reducing the amount of interface requests, avoiding the waste of traffic, and the consumption of background resources. For subsequent high-concurrency scenarios, not only some bottlenecks in the performance of the application are solved, but also the normal needs of the business are met, achieving a win-win mechanism.
[0022] In a second aspect, an embodiment of the present application provides an interface request method, including:
[0023] Receiving a detection message; the detection message is used to detect changes in the interface;
[0024] Return a detection response message according to the detection message; the detection response message indicates whether the configuration information corresponding to the interface has changed;
[0025] A request call for a changed interface is received, and configuration information corresponding to the changed interface is returned according to the request call.
[0026] In one possible implementation manner, when the interfaces detected by the detection message include a first interface, and configuration information corresponding to the first interface changes; the method further includes:
[0027] The configuration information corresponding to the first interface is cached in a centralized cache; when the detection response message is returned according to the received detection message, the detection response message includes the changed configuration information corresponding to the first interface; the first interface is an interface of a first magnitude type.
[0028] In one possible implementation, the method further includes: when configuration information corresponding to the interface changes, updating the interface version of the interface;
[0029] When the interfaces detected by the detection message include a second interface, and the configuration information corresponding to the second interface changes; the detection response message includes the interface version change result of the second interface; the second interface is an interface of a second order of magnitude type.
[0030] In a third aspect, an embodiment of the present application provides an interface request device, including:
[0031] A first sending unit is used to send a detection message to the server in the process of triggering the display of the target page; the detection message is used to detect the change of the interface;
[0032] A first receiving unit is used to receive a detection response message returned by the server; the detection response message indicates whether the configuration information corresponding to the interface has changed;
[0033] The first processing unit is used to request the server to call the changed interface and obtain the configuration information corresponding to the changed interface; and to obtain the configuration information corresponding to the unchanged interface from the local computer.
[0034] The first processing unit is further configured to display the target page according to the acquired configuration information.
[0035] In one possible implementation manner, the first processing unit is further configured to, when adding a new interface for the target page, register the new interface in the detection system through a registration system, and record the registered interface version information in a storage system.
[0036] In one possible implementation, the first processing unit is further configured to obtain interface version information of the registered interface from the storage system through the detection system;
[0037] The first sending unit is specifically configured to send a detection message carrying the interface version information to a server through the detection system.
[0038] In one possible implementation, the detection response message includes information generated by the server judging whether configuration information corresponding to the interface has changed according to the received interface version information;
[0039] The first processing unit is further configured to synchronously update the interface version information of the changed interface to the storage system through the detection system for the changed interface after the first receiving unit receives the detection response message returned by the server.
[0040] In a fourth aspect, an embodiment of the present application provides an interface request device, including:
[0041] A second receiving unit is used to receive a detection message; the detection message is used to detect changes in the interface;
[0042] A second sending unit is used to return a detection response message according to the detection message; the detection response message indicates whether the configuration information corresponding to the interface has changed;
[0043] The second processing unit is used to receive a request call for the changed interface, and return the configuration information corresponding to the changed interface through the second sending unit according to the request call.
[0044] In one possible implementation manner, when the interface detected by the detection message includes a first interface and the configuration information corresponding to the first interface changes; the second processing unit is further used to:
[0045] The configuration information corresponding to the first interface is cached in a centralized cache; when the second sending unit is triggered to return the detection response message according to the received detection message, the detection response message includes the changed configuration information corresponding to the first interface; the first interface is an interface of a first magnitude type.
[0046] In one possible implementation, the second processing unit is further configured to update an interface version of the interface when configuration information corresponding to the interface changes;
[0047] When the interfaces detected by the detection message include a second interface, and the configuration information corresponding to the second interface changes; the detection response message includes the interface version change result of the second interface; the second interface is an interface of a second order of magnitude type.
[0048] In a fifth aspect, an embodiment of the present application provides an interface request device, comprising a processor, wherein the processor is configured to call stored program instructions to execute the method of the first aspect above.
[0049] In a sixth aspect, an embodiment of the present application provides an interface request device, comprising a processor, wherein the processor is configured to call stored program instructions to execute the method of the second aspect above.
[0050] In a seventh aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method of the first aspect described above.
[0051] In an eighth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method of the second aspect above.
[0052] It should be understood that the third to eighth aspects of the present application are consistent with the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments.
[0054] Figure 1 It is a schematic diagram of the scenario architecture of the interface request method provided in the embodiment of the present application;
[0055] Figure 2 It is a flowchart of the interface request method provided in the embodiment of the present application;
[0056] Figure 3 It is a schematic diagram of the system architecture of the interface request method provided in the embodiment of the present application;
[0057] Figure 4 is a structural diagram of an interface request device provided in an embodiment of the present application;
[0058] Figure 5 is a structural diagram of an interface request device according to another embodiment of the present application;
[0059] Figure 6 is a schematic block diagram of an interface request device provided in an embodiment of the present application;
[0060] Figure 7 It is a structural diagram of another interface request device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0061] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0062] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0063] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0064] In order to better understand the interface request method provided in the embodiment of the present application, first refer to Figure 1 The scenario architecture diagram of the interface request method provided in the embodiment of the present application is illustrated. Figure 1 It includes a server 101 and multiple terminals 102. Among them:
[0065] The server 101 in the embodiment of the present application can be a backend server corresponding to the client, which mainly provides a series of related functions or services for the operation of the client. After receiving various requests sent by the client, the server 101 processes the request and returns relevant data to the client. In the present application, the server 101 can also be referred to as a backend server, a component server, etc.
[0066] The terminal 102 in the embodiment of the present application may be an electronic device with a client installed and running. In the present application, the client refers to a program corresponding to the server 101 that provides local services to customers (including merchants and parents). Here, the local service may include but is not limited to: human-computer interaction services, local data collection and maintenance services, communication services between local and server, etc.
[0067] Specifically, the client may include: locally running applications, functions running on a web browser (also known as Web App), applets embedded in emails, applets embedded in instant messaging client software (such as WeChat), and functions (such as WeChat public accounts) embedded in other applications (such as WeChat), etc. For the client, the server 101 needs to run corresponding server-side programs to provide corresponding services, such as database services, data calculations, decision execution, etc.
[0068] The terminal 102 in the embodiment of the present application may include but is not limited to mobile phones, mobile computers, tablet computers, personal digital assistants (PDAs), media players, smart TVs, smart watches, smart glasses, smart bracelets and other terminals or devices.
[0069] The interface in the embodiment of the present application is an interface for mutual communication between the client and the server; the server side can correspond to multiple different interfaces. When the client triggers to enter the target page, for example, when the client starts to enter the home page, it needs to request the interface corresponding to the home page from the server to obtain the interface data (such as the configuration information corresponding to the interface), so as to generate and display the target page. As the design of the client becomes more and more complex and the operation scenarios become more and more, the client often needs to request many interfaces from the server. The following describes how the interface request method of the embodiment of the present application solves the problem of the system crashing easily due to too many requested interfaces in the process of entering the page in the prior art, and ensures that the business functions are normal and not affected.
[0070] like Figure 2 The flowchart of the interface request method provided in the embodiment of the present application shown may include the following steps:
[0071] Step S200: The terminal sends a detection message to the server;
[0072] Specifically, when a user enters a target page through a terminal operation client, for example, when a user starts a client to enter a home page, the terminal sends a detection message to a backend server corresponding to the client to detect or inquire about changes in the interface. The number of interfaces detected or inquired is often multiple.
[0073] Step S202: The server receives the detection message and generates a detection response message;
[0074] Specifically, after receiving the detection message, the server checks the changes of the interface detected or queried by the terminal, specifically, whether the configuration information corresponding to the interface has changed, and then generates a detection response message, which can be used to indicate whether the configuration information corresponding to the interface has changed.
[0075] Step S204: the server returns a detection response message to the terminal;
[0076] Step S206: The terminal receives a detection response message;
[0077] Step S208: The terminal parses the probe response message;
[0078] Specifically, the terminal parses the received detection response message to learn which interfaces have changed and which interfaces have not changed. In other words, the terminal will know whether there are any interfaces that have changed or not changed among the detected or queried interfaces; if there are any changes, which interfaces have changed; if there are no changes, which interfaces have not changed.
[0079] Step S210: the terminal requests the server to call the changed interface;
[0080] Specifically, for a changed interface, the terminal requests the server to call the interface to obtain configuration information corresponding to the changed interface returned from the server.
[0081] Step S212: Obtain configuration information corresponding to the unchanged interface from the local;
[0082] Specifically, for an interface that has not changed, the terminal may not need to request the server to call the interface, but may directly obtain the stored configuration information corresponding to the interface locally.
[0083] Among them, there is no order in which steps S210 and S212 are executed, they can be executed simultaneously, or any one of them can be executed first, and this application does not limit this.
[0084] Step S214: the server receives a request call for the changed interface, and returns configuration information corresponding to the changed interface according to the request call;
[0085] Specifically, after parsing the request call, the server finds out the configuration information corresponding to the interface requested to be called, and then returns the configuration information to the terminal.
[0086] Step S216: The terminal receives the configuration information corresponding to the changed interface, and displays the target page according to the acquired configuration information.
[0087] Specifically, after the terminal obtains all configuration information (including configuration information obtained from the server and configuration information obtained locally), it can complete the response of the user operation client entering the target page and display the target page. For example, respond to start the client and enter the display home page.
[0088] By implementing the embodiments of the present application, by sending a detection message to inquire about the changes in the interface, there is no need to initiate a request call to the server for the interface that has not changed. For an APP with too many configuration information interfaces on the target page to be entered (such as the homepage), when the configuration changes are small, a lot of interface requests will be saved, reducing the pressure on the background server. That is, the problem of the system being prone to crash due to too many request interfaces in the process of entering the page in the prior art is solved, and the business functions can be guaranteed to be normal and unaffected, and it has a wide range of applications.
[0089] In one implementation, the client of the embodiment of the present application may include three parts: a detection system, a registration system, and a storage system. The three parts may form a client probe system, which completes the client's interface request by rationally dividing the work of the three parts and cooperating directly and efficiently with each other. Figure 3 The system architecture diagram of the interface request method provided in the embodiment of the present application is illustrated as follows:
[0090] The client can include three parts: the detection system, the registration system, and the storage system. The detection system can be responsible for communicating with the backend server to detect the version changes of the interface; the registration system can be responsible for adding the interface to be monitored to the detection system in order to monitor the changes of the interface; the storage system can be responsible for storing the interface version information.
[0091] In one embodiment, the interface request method of the embodiment of the present application may also include: when adding a new interface to the target page, registering the new interface in the detection system through the registration system, and recording the interface version information after registration in the storage system. Specifically, for example, when a new interface needs to be added to the APP homepage, for example, there is a new requirement to add an interface and call it at startup, then the interface is registered in the detection system through the registration system, and the interface version information after registration will be recorded in the storage system.
[0092] In one implementation manner, the above step S200 in which the terminal sends a detection message to the server may include: the client of the terminal obtains the interface version information of the registered interface from the storage system through the detection system; and sends the detection message carrying the interface version information to the server through the detection system.
[0093] After receiving the detection message, the server can return a detection response message to the detection system according to the actual situation to indicate the relevant information of the interface. Specifically, the server stores the relevant information of the interface, including the interface name and interface version number. When the data of the interface (such as configuration information) changes, the corresponding interface version number can be processed as +1. When the server receives a detection message carrying interface version information, it can compare the interface version in the detection message with the stored interface version (i.e., interface version number). If they are inconsistent, it indicates that the interface has changed (i.e., the version information corresponding to the interface has changed). If they are consistent, it indicates that the interface has not changed.
[0094] That is, the server can generate a detection response message based on the comparison result, and the detection response message is generated by judging whether the configuration information corresponding to the interface has changed according to the received interface version information. When the configuration information corresponding to the interface has changed, the detection response message can carry the interface version information corresponding to the changed interface.
[0095] In one possible implementation manner, after receiving the detection response message returned by the server, the terminal may further include: for the changed interface, synchronously updating the interface version information of the changed interface to the storage system through the detection system.
[0096] Change rules can be preset for changes in the interface version number. There can be multiple change rules. For example, if the data is not updated once, the value of a specific position of the version number changes. For example, the initial version number is defined as 0000. When the functional module information mapped by the communication interface is updated, the version number value increases by 1, that is, it becomes 0001. When the data is updated again, it becomes 0002, and so on. By formulating preset change rules and the original version number, the version number after the data change can be distinguished from the version number in the previous state.
[0097] In one embodiment, the original version number can be the line value of the communication interface file; the functional module mapped by the communication interface is implemented through a combination of program fields. When the program fields are increased or decreased, the number of lines of program code may change. Based on the above reasons, the original version number is defined in this application as the line value of the communication interface file. Once the functional module changes and is reflected in the number of lines of code, the corresponding real-time version number will change.
[0098] The above three parts of the system of the embodiment of the present application can form a client probe system. By reasonably dividing the work among the three parts and cooperating directly and efficiently with each other to complete the client's interface request, the problem of the system being prone to crash due to too many interface requests during the process of entering the page in the prior art can be further quickly and effectively solved.
[0099] In one possible implementation manner, the embodiment of the present application may divide the interface into two types of interfaces, including a first type of interface and a second type of interface.
[0100] Specifically, the server of the embodiment of the present application can be divided into two data structure interfaces, one is a data structure that requires a secondary request from the client, and the other is a data structure returned in real time. For the interface of the secondary request data structure, when the data corresponding to the interface is changed or changed, such as the interface driver is updated, or the data driver is updated, each update will trigger an update event, and the interface version number corresponding to the interface will be processed as +1. When the client detects, it is necessary to return the version change result to the client. This type of interface is the interface of the second order type of the embodiment of the present application, or it is called a heavyweight interface. For the interface of the real-time return data structure, when the data is changed or changed, the server directly caches the data of the interface into the centralized cache, and when the probe detects and requests the interface, the server directly returns the data of the interface to the client, thereby avoiding the client from making a secondary request to the interface, reducing the request amount of the interface. This type of interface is the interface of the first order type of the embodiment of the present application, or it is called a lightweight interface. A lightweight interface may be an interface mode designed with a lightweight framework. The lightweight framework does not have an invasive application programming interface (API), has no dependency on containers, is easy to configure, easy to use, and has a short startup time.
[0101] Then, the interface request method of the embodiment of the present application may also include:
[0102] The server caches the configuration information corresponding to the first interface in a centralized cache; the first interface is an interface of a first order of magnitude type. When the interfaces detected by the detection message include the first interface, and the configuration information corresponding to the first interface changes; when the server returns the detection response message according to the received detection message, the detection response message may directly include the configuration information corresponding to the first interface after the change;
[0103] The interface request method of the embodiment of the present application may also include: when the configuration information corresponding to the interface changes, the server updates the interface version of the interface; when the interface detected by the detection message includes a second interface, and the configuration information corresponding to the second interface changes; the detection response message includes the interface version change result of the second interface; the second interface is an interface of the second magnitude type. When the terminal receives the detection response message, the interface version information of the changed interface is synchronously updated to the storage system through the detection system.
[0104] Based on the interface request scheme of the embodiment of the present application, the detection heartbeat mechanism of the client and the server can be used to solve the problem of fast and timely update and synchronization of data in the absence of a long connection mechanism to a certain extent. At the same time, a combination of the first order type (such as lightweight) interface and the second order type (such as heavyweight) interface is adopted. For lightweight interfaces, when the data (equivalent to configuration information) changes, the interface version of the corresponding interface can be left unchanged, but the data of the interface is directly cached in a centralized cache. When the probe requests, the server directly returns the data, directly avoiding the client from making a secondary request, further reducing the amount of interface requests, avoiding the waste of traffic, and the consumption of background resources. For subsequent high-concurrency scenarios, not only some bottlenecks in the performance of the application are solved, but also the normal needs of the business are met, achieving a win-win mechanism.
[0105] In order to better implement the above solution of the embodiment of the present application, the present application also provides an interface request device, such as Figure 4 The structure diagram of the interface request device provided in the embodiment of the present application is shown, the interface request device 40 includes: a first sending unit 400, a first receiving unit 402 and a first processing unit 404, wherein,
[0106] The first sending unit 400 is used to send a detection message to the server during the process of triggering the display of the target page; the detection message is used to detect changes in the interface;
[0107] The first receiving unit 402 is used to receive a detection response message returned by the server; the detection response message indicates whether the configuration information corresponding to the interface has changed;
[0108] The first processing unit 404 is used for requesting the server to call the changed interface and obtain the configuration information corresponding to the changed interface for the changed interface; for the unchanged interface, obtaining the configuration information corresponding to the unchanged interface from the local;
[0109] The first processing unit 404 is further configured to display the target page according to the acquired configuration information.
[0110] In one possible implementation manner, the first processing unit 404 is further configured to, when adding a new interface for the target page, register the new interface in the detection system through a registration system, and record the registered interface version information in a storage system.
[0111] In one possible implementation, the first processing unit 404 is further configured to obtain interface version information of the registered interface from the storage system through the detection system;
[0112] The first sending unit 400 is specifically configured to send a detection message carrying the interface version information to a server through the detection system.
[0113] In one possible implementation, the detection response message includes information generated by the server judging whether configuration information corresponding to the interface has changed according to the received interface version information;
[0114] The first processing unit 404 is further configured to synchronously update the interface version information of the changed interface to the storage system through the detection system for the changed interface after the first receiving unit 402 receives the detection response message returned by the server.
[0115] The interface request device 40 is a terminal running a client in the present application. The specific implementation of the above-mentioned various functional components in the interface request device 40 can refer to the relevant descriptions in the above-mentioned various method embodiments, and the embodiments of the present application will not be repeated.
[0116] like Figure 5 The structure diagram of the interface request device of another embodiment provided by the present application is shown, the interface request device 50 comprises: a second receiving unit 500, a second sending unit 502 and a second processing unit 504, wherein:
[0117] The second receiving unit 500 is used to receive a detection message; the detection message is used to detect changes in the interface;
[0118] The second sending unit 502 is used to return a detection response message according to the detection message; the detection response message indicates whether the configuration information corresponding to the interface has changed;
[0119] The second processing unit 504 is used to receive a request call for a changed interface, and return configuration information corresponding to the changed interface through the second sending unit 502 according to the request call.
[0120] In one possible implementation manner, when the interface detected by the detection message includes a first interface, and the configuration information corresponding to the first interface changes; the second processing unit 504 is further used to:
[0121] The configuration information corresponding to the first interface is cached in a centralized cache; when the second sending unit 500 is triggered to return the detection response message according to the received detection message, the detection response message includes the changed configuration information corresponding to the first interface; the first interface is an interface of a first magnitude type.
[0122] In one possible implementation, the second processing unit 504 is further configured to update the interface version of the interface when the configuration information corresponding to the interface changes;
[0123] When the interfaces detected by the detection message include a second interface, and the configuration information corresponding to the second interface changes; the detection response message includes the interface version change result of the second interface; the second interface is an interface of a second order of magnitude type.
[0124] The interface request device 50 is the background server corresponding to the client in this application. The specific implementation of the above-mentioned various functional components in the interface request device 50 can refer to the relevant description in the above-mentioned various method embodiments, and the embodiments of this application will not be repeated.
[0125] Figure 6 A schematic block diagram of an interface request device provided in an embodiment of the present application; Figure 6 The interface request device 600 shown (the device 600 can be a terminal) includes a memory 601, a baseband chip 602, a radio frequency module 603, a peripheral system 604 and a sensor 605. The baseband chip 602 includes at least one processor 6021, such as a CPU, a clock module 6022 and a power management module 6023; the peripheral system 604 includes a camera 6041, an audio module 6042, a touch display screen 6043, etc., and further, the sensor 605 can include a light sensor 6051, an acceleration sensor 6052, a fingerprint sensor 6053, etc.; the modules included in the peripheral system 604 and the sensor 605 can be increased or reduced according to actual needs. Any two of the above connected modules can be connected specifically through a bus, which can be an industrial standard architecture (English: industry standard architecture, abbreviated: ISA) bus, a peripheral component interconnect (English: peripheral component interconnect, abbreviated: PCI) bus or an extended industry standard architecture (English: extended industry standard architecture, abbreviated: EISA) bus, etc.
[0126] The radio frequency module 603 may include an antenna and a transceiver (including a modem), the transceiver is used to convert the electromagnetic waves received by the antenna into electric current and finally into digital signals, and accordingly, the transceiver is also used to convert the digital signal to be output by the mobile phone into electric current and then into electromagnetic waves, and finally transmit the electromagnetic waves into free space through the antenna. The radio frequency module 603 may also include at least one amplifier for amplifying the signal. Generally, wireless transmission can be performed through the radio frequency module 603, such as Bluetooth (English: Bluetooth) transmission, wireless guarantee (English: Wireless-Fidelity, referred to as: WI-FI) transmission, third-generation mobile communication technology (English: 3rd-Generation, referred to as: 3G) transmission, fourth-generation mobile communication technology (English: the 4th Generation mobile communication, referred to as: 4G) transmission, etc.
[0127] The touch display screen 6043 can be used to display information input by the user or to display information to the user. The touch display screen 6043 may include a touch panel and a display panel. Optionally, the display panel may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel may cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 6021 to determine the type of touch event, and then the processor 6021 provides a corresponding visual output on the display panel according to the type of touch event. The touch panel and the display panel are two independent components to implement the input and output functions of the interface request device 600, but in some embodiments, the touch panel and the display panel may be integrated to implement the input and output functions of the interface request device 600.
[0128] The camera 6041 is used to acquire images.
[0129] The audio input module 6042 may specifically be a microphone, which may acquire voice.
[0130] The sensor 605 may include a light sensor 6051, an acceleration sensor 6052, and a fingerprint sensor 6053. The light sensor 6051 is used to obtain the light intensity of the environment, the acceleration sensor 6052 (such as a gyroscope, etc.) can obtain the motion state of the interface request device 600, and the fingerprint sensor 6053 can input fingerprint information; after the sensor 605 senses the relevant signal, the signal is quantized into a digital signal and transmitted to the processor 6021 for further processing.
[0131] The memory 601 may be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The memory 601 may optionally include at least one storage device located away from the aforementioned processor 6021. The memory 601 may specifically include a storage instruction area and a storage data area, wherein the storage instruction area may store programs such as an operating system, a user interface program, and a communication interface program, and the storage data area may store data required by the processor to perform related operations, or data generated by performing related operations.
[0132] The processor 6021 is the control center of the interface request device 600, which uses various interfaces and lines to connect various parts of the entire mobile phone, and executes various functions of the interface request device 600 by running programs stored in the memory 601 and calling data stored in the memory 601. Optionally, the processor 6021 may include one or more application processors, which mainly process operating systems, user interfaces, and application programs. In the embodiment of the present application, the processor 6021 reads the information in the memory 601 and completes the interface request method of the embodiment of the present application in combination with its hardware.
[0133] The user implements the communication function of the interface request device 600 through the radio frequency module 603 .
[0134] Specifically, in the process of triggering the display of the target page, the processor 60211 sends a detection message to the server through the radio frequency module 603; the detection message is used to detect changes in the interface;
[0135] The processor 6021 receives a detection response message returned by the server through the radio frequency module 603; the detection response message indicates whether the configuration information corresponding to the interface has changed;
[0136] For the interface that has changed, the processor 6021 requests the server to call the interface that has changed through the radio frequency module 603 to obtain the configuration information corresponding to the interface that has changed; for the interface that has not changed, the processor 6021 obtains the configuration information corresponding to the interface that has not changed from the local;
[0137] The processor 6021 displays the target page according to the acquired configuration information.
[0138] In one possible implementation, the processor 6021 may further execute:
[0139] When a new interface is added to the target page, the new interface is registered in the detection system through the registration system, and the version information of the registered interface is recorded in the storage system.
[0140] In one possible implementation, the processor 6021 sends a detection message to the server through the radio frequency module 603, which may include:
[0141] The processor 6021 obtains the interface version information of the registered interface from the storage system through the detection system;
[0142] The radio frequency module 603 sends a detection message carrying the interface version information to the server through the detection system.
[0143] In one possible implementation, the detection response message includes information generated by the server judging whether configuration information corresponding to the interface has changed according to the received interface version information;
[0144] After the processor 6021 receives the detection response message returned by the server through the radio frequency module 603, it also includes: for the changed interface, the processor 6021 synchronously updates the interface version information of the changed interface to the storage system through the detection system.
[0145] It should be noted that the interface request device 600 is a terminal running a client in this application. The specific implementation of each of the above functional units can refer to the relevant descriptions in the above method embodiments, and the embodiments of this application will not be repeated. The specific implementation and beneficial effects of each of the above operations can also refer to the above Figures 1 to 5 The embodiments provided in and the corresponding description of their possible embodiments.
[0146] Figure 7 It is a structural diagram of another interface request device provided in an embodiment of the present application. Figure 7 The interface request device 700 shown (the device may be a computer device) includes a memory 701, a processor 702, a communication interface 703 and a bus 704. The memory 701, the processor 702 and the communication interface 703 are connected to each other through the bus 704.
[0147] The memory 701 may be a read-only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM). The memory 701 may store a program. When the program stored in the memory 701 is executed by the processor 702, the processor 702 and the communication interface 703 are used to execute the various steps of the interface request method of the embodiment of the present application.
[0148] The processor 702 can adopt a general central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU) or one or more integrated circuits to execute relevant programs to execute the interface request method of the method embodiment of the present application.
[0149] The processor 702 may also be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the training method of the sample generator of the present application may be completed by an integrated logic circuit of hardware or software instructions in the processor 702. The above-mentioned processor 702 may also be a general-purpose processor, a digital signal processor (DigitalSignal Processing, DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (Field ProgrammableGate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in a decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 701, and the processor 702 reads the information in the memory 701 and completes the interface request method of the embodiment of the method of the present application in combination with its hardware.
[0150] In one possible implementation, the interface request device 700 may not include the memory 701, and the processor 702 may obtain the program stored in the cloud through the communication interface 703 to execute the steps of the interface request method of the application method embodiment.
[0151] The communication interface 703 uses a transceiver device such as, but not limited to, a transceiver to implement communication between the device 700 and other devices or communication networks. For example, a detection message may be sent or a detection response message may be received via the communication interface 703 .
[0152] The bus 704 may include a path for transmitting information between various components of the device 700 (eg, the memory 701 , the processor 702 , and the communication interface 703 ).
[0153] Specifically, the processor 702 receives a detection message through the communication interface 703; the detection message is used to detect changes in the interface;
[0154] The processor 702 returns a detection response message according to the detection message through the communication interface 703; the detection response message indicates whether the configuration information corresponding to the interface has changed;
[0155] The processor 702 receives a request call for a changed interface through the communication interface 703, and returns configuration information corresponding to the changed interface according to the request call.
[0156] In one possible implementation manner, when the interface detected by the detection message includes a first interface, and configuration information corresponding to the first interface changes; the processor 702 may further execute:
[0157] The configuration information corresponding to the first interface is cached in a centralized cache; when the processor 702 returns the detection response message according to the received detection message through the communication interface 703, the detection response message includes the changed configuration information corresponding to the first interface; the first interface is an interface of a first magnitude type.
[0158] In one possible implementation manner, the processor 702 may further execute: when configuration information corresponding to the interface changes, updating the interface version of the interface;
[0159] When the interfaces detected by the detection message include a second interface, and the configuration information corresponding to the second interface changes; the detection response message includes the interface version change result of the second interface; the second interface is an interface of a second order of magnitude type.
[0160] It should be noted that the interface request device 700 is the server corresponding to the client in this application. The specific implementation of each of the above functional units can refer to the relevant descriptions in the above method embodiments, and the embodiments of this application will not be repeated. The specific implementation and beneficial effects of each of the above operations can also refer to the above Figures 1 to 5 The embodiments provided in and the corresponding description of their possible embodiments.
[0161] It should be understood that the application scenarios to which the methods provided in the embodiments of the present application can be applied are only examples and are not limited to these in practical applications.
[0162] It should also be understood that the first, second, third and various numerical numbers involved in the present application are merely distinctions made for the convenience of description and are not intended to limit the scope of the present application.
[0163] It should be understood that the term "and / or" in this application is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this application generally indicates that the associated objects before and after are in an "or" relationship.
[0164] In addition, in each embodiment of the present application, the size of the serial number of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0165] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0166] Technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0167] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules and units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0168] The units described as separate components may be physically separated or not, and the components displayed as units may be physical units or not, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present application.
[0169] In addition, each functional unit involved in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units, and the present application does not limit this.
[0170] The embodiment of the present invention further provides a computer storage medium, in which instructions are stored, and when the instructions are executed on a computer or a processor, the computer or the processor executes one or more steps of the method described in any of the above embodiments. If the components of the above device are implemented in the form of software functional units and sold or used as independent products, they can be stored in the computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer product is stored in a computer-readable storage medium.
[0171] The computer-readable storage medium may be an internal storage unit of the device described in the foregoing embodiments, such as a hard disk or a memory. The computer-readable storage medium may also be an external storage device of the device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Further, the computer-readable storage medium may also include both an internal storage unit of the device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
[0172] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes.
[0173] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.
[0174] The modules in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.
[0175] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. An interface request method, characterized in that: include: When the data of the lightweight interface of the server changes, the server caches the data of the interface in the centralized cache. When the data of the heavyweight interface of the server changes, each update triggers an update event, and the version number of the interface with data changes is increased by 1; wherein, the preset change rules of the interface version number change include: the original version number is the line value of the communication interface file, the function module mapped by the communication interface is realized by the combination of program fields, when the program field is increased or decreased, the line value of the program code will change, the change of the function module mapped by the communication interface is reflected in the line value of the code, and the corresponding real-time version number changes; When the user enters the homepage through the terminal operation client, the client sends a detection message to the server; the detection message is used to detect changes in multiple interfaces corresponding to the homepage, and the detection message includes the interface version that needs to be detected. The client includes a detection system, a registration system and a storage system. The detection system is responsible for communicating with the server and detecting changes in the version number of the interface. The registration system is responsible for adding the interface that needs to be monitored to the detection system in order to monitor changes in the interface. The storage system is responsible for storing the version information of the interface that needs to be monitored; when adding a new interface to the homepage, the new interface is registered in the detection system through the registration system, and the new interface version information after registration is recorded in the storage system, and the detection message includes the new interface version information after registration; The server receives the detection message, and compares the interface version number in the detection message with the interface version number stored in the server. If they are inconsistent, it indicates that the configuration information of the interface has changed; if they are consistent, it indicates that the configuration information of the interface has not changed; When the interface detected by the detection message includes a first interface, the first interface is a lightweight interface, and the configuration information corresponding to the first interface changes, when the server returns a detection response message according to the received detection message, the detection response message includes the configuration information corresponding to the first interface after the change; When the interface detected by the detection message includes a second interface, and the second interface is a heavyweight interface, and the configuration information of the second interface changes, the server sends a detection response message, and the detection response message indicates that the configuration information corresponding to the second interface has changed, and the detection response message includes the interface version number corresponding to the second interface after the change; The client receives the detection response message returned by the server, and for the changed second interface, synchronously updates the interface version number of the changed second interface to the storage system through the detection system; For the second interface whose configuration information has changed, the client requests the server to call the second interface with the change, and obtains the configuration information corresponding to the second interface with the change; For interfaces whose configuration information has not changed, obtaining configuration information corresponding to the interfaces that have not changed from a local computer; The client displays the home page according to the acquired configuration information.
2. The method according to claim 1, characterized in that: The sending of a detection message to the server comprises: The client obtains interface version information of the registered interface from the storage system through the detection system; The client sends a detection message carrying the interface version information to the server through the detection system.
3. The method according to claim 1, characterized in that The method further comprises: The server receives a request call for a changed interface, and returns configuration information corresponding to the changed interface according to the request call.
4. An interface request system, characterized in that: Including client and server: The server is used to cache the data of the interface in a centralized cache when the data of the lightweight interface of the server is changed, and when the data of the heavyweight interface of the server is changed, each update will trigger an update event, and the version number of the interface with data change will be increased by 1; wherein, the preset change rule of the change of the interface version number includes: the original version number is the line value of the communication interface file, the function module mapped by the communication interface is realized by a combination of program fields, when the program field is increased or decreased, the line value of the program code will change, the change of the function module mapped by the communication interface is reflected in the line value of the code, and the corresponding real-time version number changes; The client is used to send a detection message to the server when the user enters the homepage through the terminal operation client; the detection message is used to detect changes in multiple interfaces corresponding to the homepage, and the detection message includes the interface version that needs to be detected. The client includes a detection system, a registration system and a storage system. The detection system is responsible for communicating with the server and detecting changes in the version number of the interface. The registration system is responsible for adding the interface to be monitored to the detection system in order to monitor changes in the interface. The storage system is responsible for storing version information of the interface to be monitored; when a new interface is added to the homepage, the new interface is registered in the detection system through the registration system, and the new interface version information after registration is recorded in the storage system, and the detection message includes the new interface version information after registration; The server is used to receive the detection message, compare the interface version number in the detection message with the interface version number stored in the server, if they are inconsistent, it indicates that the configuration information of the interface has changed, if they are consistent, it indicates that the configuration information of the interface has not changed; When the interface detected by the detection message includes a first interface, the first interface is a lightweight interface, and the configuration information corresponding to the first interface changes, when a detection response message is returned according to the received detection message, the detection response message includes the configuration information corresponding to the first interface after the change; When the interface detected by the detection message includes a second interface, and the second interface is a heavyweight interface, and the configuration information of the second interface changes, the server sends a detection response message, and the detection response message indicates that the configuration information corresponding to the second interface has changed, and the detection response message includes the interface version number corresponding to the second interface after the change; The client is used to receive the detection response message returned by the server, and for the changed second interface, synchronously update the interface version number of the changed second interface to the storage system through the detection system; For the second interface whose configuration information has changed, the client requests the server to call the second interface with the change, and obtains the configuration information corresponding to the second interface with the change; For interfaces whose configuration information has not changed, obtaining configuration information corresponding to the interfaces that have not changed from a local computer; The client displays the home page according to the acquired configuration information.
5. An interface request device, characterized in that: The method comprises a processor configured to call stored program instructions to execute the method according to any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 3.
