WO2020135485A1 - Procédé, appareil et dispositif d'acquisition de résultat - Google Patents
Procédé, appareil et dispositif d'acquisition de résultat Download PDFInfo
- Publication number
- WO2020135485A1 WO2020135485A1 PCT/CN2019/128240 CN2019128240W WO2020135485A1 WO 2020135485 A1 WO2020135485 A1 WO 2020135485A1 CN 2019128240 W CN2019128240 W CN 2019128240W WO 2020135485 A1 WO2020135485 A1 WO 2020135485A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- target api
- api
- cache
- target
- return
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/547—Remote procedure calls [RPC]; Web services
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
Definitions
- This application relates to the field of mobile terminals, and in particular, to a method, device, and device for obtaining results.
- a process in order to ensure the security of the data, each process runs independently and cannot directly use the resources of other processes.
- a process may need to use the resources of other processes, for example, a service process can provide services for the process where the application is located, so that the application can use the resources of the service process to achieve the desired function, such as service
- the process can provide terminal memory information, hard disk information, etc. for the application.
- the service process provides services for the process where the application is located, and can be implemented through inter-process communication (IPC). Specifically, corresponding application programming interfaces (APIs) can be set for these services in advance.
- the application can use the resources in the service process by calling the APIs corresponding to the services to achieve the desired functions.
- Embodiments of the present application provide a method, device, and device for obtaining a result.
- a return result corresponding to a target API By storing a return result corresponding to a target API in a cache, the number of calls to the target API is reduced, system load is reduced, and system performance is improved.
- the first aspect of the present application provides a method for obtaining results.
- the method includes:
- the target API in response to the first request instruction to the target API, the target API is called to obtain the return result of the target API, and the target API and the return result are stored in the cache correspondingly, therefore, in response to the second request to the target API Instruction, you can find the return result corresponding to the target API in the cache, without having to call the target API again to get the return result of the target API, reducing the number of calls to the target API, thereby reducing system load and improving system performance.
- the searching the cache for the returned result corresponding to the target API includes:
- the returned result corresponding to the target API found in the cache satisfies the valid time condition. Therefore, the returned result is a valid result, thereby improving the accuracy of the returned result.
- the method further includes:
- the target API is called to obtain the return result corresponding to the target API.
- the method further includes:
- the type of the target API is the first preset type.
- the first preset type indicates that the return result of the target API is related to time, but the difference between multiple return results is not large. Therefore, it can be determined whether the return result corresponding to the target API meets the valid time condition. If it is, it means that the return result is valid. If not, the returned result is considered invalid.
- the method further includes:
- the method further includes:
- the to-be-processed API determine whether the to-be-processed API is a target API, and the target API is a first preset type or a second preset type; the first preset type represents multiple times of the target API The return results are different, and the difference between the multiple return results is less than or equal to a preset difference, and the second preset type indicates that the multiple return results of the target API are the same.
- the target API is of a specific type in the to-be-processed API, such as the first preset type or the second preset type, and the returned result corresponding to the target API can be stored to reduce the number of times the target API is called.
- the method further includes:
- the return result corresponding to the target API can also be deleted or updated according to the service information, so that the return result corresponding to the target API is more accurate.
- the responding to the first request instruction to the target API, invoking the target API, and obtaining a return result of the target API includes:
- the target API In response to the first request instruction to the target API, if the return result corresponding to the target API does not exist in the cache, the target API is called to obtain the return result corresponding to the target API.
- the return result corresponding to the target API may be searched first, and if the cache does not exist, then the target API is called to reduce the number of times the target API is called.
- a second aspect of an embodiment of the present application provides an apparatus for obtaining results.
- the apparatus includes:
- a first calling unit configured to call the target API in response to a first request instruction to the target API, and obtain a return result of the target API
- a storage unit configured to store the target API and the returned result correspondingly in the cache
- the searching unit is configured to search for the returned result corresponding to the target API in the cache in response to the second request instruction to the target API.
- the search unit is specifically used to:
- the device further includes:
- the second calling unit is configured to call the target API to obtain the return result corresponding to the target API if the return result corresponding to the target API that meets the valid time condition does not exist in the cache.
- the device further includes:
- the first deleting unit is configured to delete the returned result corresponding to the target API in the cache that does not satisfy the valid time condition.
- the type of the target API is the first preset type.
- the device further includes:
- the second deleting unit is configured to delete the returned result in the cache that does not meet the valid time condition.
- the device further includes:
- a target API determining unit configured to determine whether the API to be processed is a target API according to the type of the API to be processed, and the target API is a first preset type or a second preset type; the first preset type is characterized The multiple return results of the target API are different, and the difference between the multiple return results is less than or equal to a preset difference.
- the second preset type indicates that the multiple return results of the target API are the same.
- the device further includes:
- the updating unit is configured to delete the return result corresponding to the target API in the cache when the service information of the target service corresponding to the target API changes, or, to the target API corresponding to the cache Return the result to update.
- the first calling unit is specifically configured to:
- the target API In response to the first request instruction to the target API, if the return result corresponding to the target API does not exist in the cache, the target API is called to obtain the return result corresponding to the target API.
- a third aspect of the embodiments of the present application provides a result acquisition device, where the device includes a processor and a memory;
- the memory is used to store instructions
- the processor is configured to execute the instructions in the memory and execute a method for obtaining results provided in the first aspect of the embodiments of the present application.
- a fourth aspect of an embodiment of the present application provides a computer-readable storage medium, including instructions, which when executed on a computer, causes the computer to obtain a result acquisition method provided by the first aspect of the embodiment of the present application.
- a fifth aspect of an embodiment of the present application provides a computer program product containing instructions, which, when run on a computer, causes the computer to obtain a result acquisition method provided by the first aspect of the embodiment of the present application.
- the target API in response to the first request instruction to the target API, the target API is called to obtain the return result of the target API, and the target API and the return are correspondingly stored in the cache
- the return result corresponding to the target API can be found in the cache without calling the target API again to get the return result of the target API, reducing the number of calls to the target API, Thereby reducing system load and improving system performance.
- FIG. 1 is a schematic diagram of information interaction for obtaining results in the prior art
- FIG. 3 is a schematic diagram of a scenario embodiment in an embodiment of the present application.
- FIG. 4 is a structural block diagram of an apparatus for obtaining results in an embodiment of the present application.
- FIG. 5 is a structural block diagram of a result acquisition device in an embodiment of this application.
- Embodiments of the present application provide a method, device, and device for obtaining results, which are used to reduce the number of target API calls in a terminal device, reduce system load, and improve system performance.
- the service process provides services for the process where the application is located, and can be realized through inter-process communication.
- the corresponding API can be set for the service in advance, and the application program can call the API to use the corresponding resource in the service process to achieve the desired function.
- an application can call the system API to obtain information such as the terminal's memory, hard disk, whether it supports Bluetooth, and whether it supports flash.
- an application in the process of using the application program, the application program may repeatedly call the API.
- FIG. 1 is a schematic diagram of information interaction for obtaining results in the prior art
- an application can make three API calls and send three information query requests to a system service.
- the system service obtains a query The result is returned to the application.
- the information query request here may be to query whether the terminal device supports a certain function, such as the Bluetooth function and the flash function.
- some of the returned results may not be related to time, that is to say, the process of calling the API three times is the same, and the query results returned by the system service are also the same. Therefore, making three API calls is completely unnecessary, resulting in unnecessary Waste of resources.
- the embodiments of the present application provide a method, device and device for obtaining a result.
- the target API When responding to the first request instruction to the target API, the target API is called to obtain the return result of the target API and stored in the cache correspondingly The target API and the corresponding return result. Therefore, in response to the second request instruction to the target API, the return result corresponding to the target API can be found in the cache without having to call the target API again to obtain the return result of the target API.
- the number of target API calls to reduce system load and improve system performance. In other words, corresponding to the three information query requests shown in Figure 1, the optimal result is that as long as the first information query is required, the target API is called once and the returned result is obtained. During the query, the corresponding return result is obtained from the cache, which greatly reduces the number of calls to the target API.
- FIG. 2 is a flowchart of a method for obtaining results in an embodiment of the present application. The following specifically describes the method for obtaining results provided by the embodiments of the present application.
- the target API corresponds to the target service. It can be a predefined function provided by the operating system or service provider.
- the application can call the API to obtain the target service without the source code of the target service or without understanding the internal principles. Resources in the process.
- inter-process communication can be achieved through Binder.
- the Android framework itself can provide a series of system services and provide Java/C++ APIs to call these services. Therefore, you can transfer the query request from the process where the application is located to the service process based on the Binder mechanism by calling the API. After the service process obtains the corresponding query result, the query result is returned to the process where the application is located through the Binder mechanism.
- the target API may be the first preset type.
- the first preset type indicates that the return result of the target API is related to time, but the difference between multiple return results is not large, that is, the time to call the target API is different, and the difference between the return results is less than or equal to the preset difference, for example
- the location gap of the mobile terminal is also small.
- the target API is the first preset type may be preset by the provider of the target service corresponding to the target API, or may be preset by an operating system developer, or may be automatically determined by the terminal device.
- the terminal device can determine the type of the target API according to the historical record of the target API call and the historical return result. Specifically, it can compare the time of calling the target API multiple times, and compare the historical return results obtained after multiple calls to the target API. If the change rate of the historical return result is less than or equal to the preset rate, the target API has the first preset type.
- the terminal device determines the type of the target API according to the historical records and historical return results of calling the target API, and can also refer to the current scene of the terminal device, for example, when the user is walking, the location of the terminal device is within a short time gap Small, at this time, it can be considered that the API corresponding to the positioning function can be the first preset type, but when the terminal device is on a vehicle with a fast moving speed, the gap in a short time is large, then the corresponding function of the positioning function cannot be considered API is the first preset type.
- the current scene of the terminal device can be obtained according to the information of the sensor of the terminal device.
- the target API may also be the second preset type.
- the second preset type indicates that the return result of the target API is independent of time, that is, the multiple return results of the target API are always the same.
- Whether the target API is the second preset type may be preset by the provider of the target service corresponding to the target API, or may be preset by the operating system developer, or may be automatically determined by the terminal device.
- the terminal device can determine the type of the target API according to the history records of the call to the target API and the historical return results. Specifically, it can compare whether multiple historical return results are always the same.
- the target API is an API with a first preset type or a second preset type, and the return result of other APIs other than that has a greater correlation with the calling time, so it is not the target API and does not belong to the embodiment of this application Need to consider the scope.
- Which target APIs are included can be determined by the service thread in multiple pending APIs, and then the determination result is sent to the thread where the application is located.
- the service thread can also send the type of pending API to the thread where the application is located.
- the thread where the program resides determines whether the API is the target API according to the type of API.
- the service thread may be the thread where the system service is located.
- the service thread may run in a separate thread, which is not limited again.
- the first request instruction to the target API may be generated according to the user's operation on the terminal device, for example, the user starts the application operation, or clicks on the corresponding control when there is a query or use demand for the target service;
- the first request instruction of the target API may also be automatically generated, for example, the information of the target service may be queried periodically, so the first request instruction is generated.
- the target API to get the return result of the target API.
- the application can query whether the current terminal device supports a certain function or feature.
- the application can query whether the current terminal device supports the Bluetooth function by calling the pm.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH) function, and the returned result can be "yes" or "no”; the application can also be called by pm.hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH) function, query whether the current device has a flash, the return result can be "yes" or "no”.
- the application can make further operations according to the return result of the target API, for example, when the current terminal device supports the Bluetooth function, the Bluetooth function can be used.
- the cache is the cache in the process where the application is located, so that the application can read the cache to obtain the return result of the target API without having to obtain it through inter-process communication; the cache here can also be the cache in the service process In this way, the process where the application is located can obtain the return result in the cache through inter-process communication with the service process, and the service process does not need to perform the action of obtaining the return result again.
- the storage time of the returned result may also be recorded, for example, adding a timestamp to the returned result.
- the return result is related to the time when the target API is called, that is, the longer the time from the call to the target API, the greater the possibility that the returned result will be invalid. Therefore, it can be
- the target API sets valid time conditions. If the storage time of the returned result meets the valid time condition, the returned result is regarded as valid data; if the stored time of the returned result does not satisfy the valid time condition, the returned result is regarded as invalid data.
- the storage time can be the time when the returned result is stored.
- the storage time of the returned result that meets the valid time condition can be specifically that the storage time is later than the preset time; the storage time can also be the length of time the returned result is stored in the cache.
- the length of time can be determined according to the current time information and the time information when the returned result is stored.
- the storage time of the returned result meeting the valid time condition may be specifically that the storage time is shorter than the preset time.
- an application can call the getProcessMemoryInfo interface to obtain the memory of the process where the application is located to detect whether the process has a memory leak. Therefore, the returned result does not change too much over time, and the time stamp can be added to the returned result. , In order to determine whether the data is within the validity period in use, so as to increase the validity of the data.
- the invalid data in the cache can also be deleted, that is, when the type of the target API is the second preset type, it is determined whether the storage time of the return result of the target API meets the effective time If the condition is not met, the returned result is deleted.
- the returned result is always valid, and the effective time condition can be any time.
- the storage time of the returned result may not be recorded, and the target is the default The return result of the API is valid data.
- the service process when it detects that the service information of the target service corresponding to the target API changes, it sends an update reminder to the process where the application is located, such as wireless network changes, turning off the screen, etc.
- an update reminder When the information changes, you can send an update reminder to the process where the application is located, and the update reminder can be sent by broadcast.
- the update reminder includes the identification of the target API, and the update reminder may also include service information of the target service corresponding to the target API.
- the thread where the application resides may delete the return result of the target API in the cache, or, based on the service information of the target service in the update reminder, update the return result of the target API in the cache to Ensure that the returned result in the cache is valid data.
- Android needs to repeatedly obtain storage information during the application startup process to determine whether the application data can be stored in a secure digital card (SD card) or internal storage device
- SD card secure digital card
- the service process can collect the storage information in real time, and send an update reminder to the process corresponding to the application when the storage information changes, so that the process where the application is located can delete or update the storage information in the cache.
- the application can register with the service process, so that the service process can collect service information corresponding to the API related to the application.
- the application can start a new thread when it is started, and send registration information to the service thread.
- the registration information can include the application identification and callback function.
- the service thread can determine which service information needs to be collected according to the application identifier. After detecting that the target service information corresponding to the target API related to the application has changed, it can send an update reminder to the thread where the application is located through a callback function.
- the registration information may also include a user ID, and the service thread determines which service information needs to be collected based on the application ID and the user ID.
- the second request instruction may be generated according to the user's operation on the terminal device or may be automatically generated.
- the target API in response to the second request instruction to the target API, the target API is called again to obtain The corresponding return result of the target API, so that multiple calls to the same target API increase the load on the system.
- the return result corresponding to the target API in response to the second request instruction, may be searched in the cache, thereby reducing the number of times the target API is called. If there is no return result corresponding to the target API in the cache, the target API can be called to obtain the return result corresponding to the target API.
- the return result corresponding to the target API can find the return result corresponding to the target API and the storage time meeting the valid time condition in the cache. Specifically, you can directly search for the return result corresponding to the target API and the storage time meets the valid time condition; you can also first obtain the return result corresponding to the target API in the cache, and then determine whether the storage time of the obtained return result is satisfactory The valid time condition, if it is, the corresponding return result is found, if not, the return result can be deleted to improve the effective utilization of the cache.
- the target API can be called to obtain the return result corresponding to the target API.
- S101 may also be specifically: in response to the first request instruction to the target API, if there is no return result corresponding to the target API in the cache, the target API is called to obtain the return result corresponding to the target API.
- the cache and the return result in the cache can be deleted.
- a BinderDied call can be generated, and the service thread deletes the data related to the application, such as application callback information.
- Tmall, Douyin, WeChat, CNTV v6.5.2 are pre-installed and installed on the mobile phone, stimulating the battlefield, Vipshop, Chedi, Tuniu Travel, Tencent Video, NetEase News 10 applications, and start 5 applications: Tmall, Douyin, WeChat, CNTV v6.5.2, stimulate the battlefield, will getPackageInfoAsUser (used to obtain the application package information), getPackageUidAsUser (used to obtain the application package Name), getApplicationInfoAsUser (for obtaining application information of the application), getVolumeList (for obtaining storage information of the current terminal device), getProcessMemoryInfo (for obtaining the memory of the process where the application is located), getDisplayInfo (for obtaining the terminal device's memory) Screen display information)
- these five target API interfaces can be added to the following interface classes: ApplicationPackageManager, ApplicationPack
- the embodiment of the present application provides a method for obtaining a result.
- the target API is called to obtain the return result of the target API, and the target API and the corresponding return result are stored in the cache correspondingly.
- the returned result corresponding to the target API can be searched in the cache. Because the application cache is in the thread where the application is located, the application can obtain the return result within the thread without calling the target API again to get the return result of the target API, which reduces the number of calls to the target API, thereby reducing System load, improve system performance.
- FIG. 3 is a schematic diagram of a scenario embodiment in an embodiment of the present application.
- the application starts.
- BindApplication a new thread is started, the application program runs in the thread, and registration information is sent to the service process, and the registration information may include an application identification, a user identification, and a callback function.
- the service thread determines the target API according to the thread ID and the user ID, notifies the application of the determination result according to the callback function, and starts to collect the service information of the target service corresponding to the target API.
- the application program calls the target API to obtain the return result of the target API.
- the application program can call the getVolumeList interface to obtain the storage information of the current terminal device.
- the application program correspondingly stores the target API and the returned result in the cache. Specifically, you can first enable the caching mechanism of the getVolumeList interface in StorageManager.java, and then store the return result of the getVolumeList interface.
- the application program In response to the second service request to the target API, the application program looks up the return result corresponding to the target API from the cache.
- the service thread collects that the service information of the target service corresponding to the target API changes, and sends an update notification to the application. For example, after the user removes the SD card and the service thread collects that the storage information has changed, it can send an update notification to the thread where the application is located through the callback information of the application.
- the application deletes the return result corresponding to the target API according to the update notification.
- the application program calls the target API, obtains the return result of the target API, and stores the target API and the return result in the cache correspondingly.
- the result obtaining apparatus 400 specifically corresponds to the function of the result obtaining method provided above.
- the function can be realized by hardware, and can also be realized by hardware executing corresponding software.
- the hardware or software includes one or more units corresponding to the above functions, and the unit may be software and/or hardware.
- the device 400 may include:
- the first calling unit 110 is configured to call the target API and obtain a return result of the target API in response to the first request instruction to the target API;
- the storage unit 120 is configured to store the target API and the returned result correspondingly in the cache
- the searching unit 130 is configured to search for the returned result corresponding to the target API in the cache in response to the second request instruction to the target API.
- the search unit is specifically used to:
- the device further includes:
- the second calling unit is configured to call the target API to obtain the return result corresponding to the target API if the return result corresponding to the target API that meets the valid time condition does not exist in the cache.
- the device further includes:
- the first deleting unit is configured to delete the returned result corresponding to the target API in the cache that does not satisfy the valid time condition.
- the type of the target API is the first preset type.
- the device further includes:
- the second deleting unit is configured to delete the returned result in the cache that does not meet the valid time condition.
- the device further includes:
- a target API determining unit configured to determine whether the API to be processed is a target API according to the type of the API to be processed, and the target API is a first preset type or a second preset type; the first preset type is characterized The multiple return results of the target API are different, and the difference between the multiple return results is less than or equal to a preset difference.
- the second preset type indicates that the multiple return results of the target API are the same.
- the device further includes:
- the updating unit is configured to delete the return result corresponding to the target API in the cache when the service information of the target service corresponding to the target API changes, or, to the target API corresponding to the cache Return the result to update.
- the first calling unit is specifically configured to:
- the target API In response to the first request instruction to the target API, if the return result corresponding to the target API does not exist in the cache, the target API is called to obtain the return result corresponding to the target API.
- the target API in response to a first request instruction to a target API, the target API is called to obtain the return result of the target API, and the target API and the return result are stored in the cache correspondingly. Therefore, In response to the second request instruction to the target API, the return result corresponding to the target API can be found in the cache without having to call the target API again to obtain the return result of the target API, which reduces the number of calls to the target API, thereby reducing the system load To improve system performance.
- the result acquisition device 500 includes:
- the receiver 501, the transmitter 502, the processor 503, and the memory 504 (wherein the number of the processor 503 in the device 500 for generating a message may be one or more, and one processor is taken as an example in FIG. 5).
- the receiver 501, the transmitter 502, the processor 503, and the memory 504 may be connected through a bus or in other ways. In FIG. 5, connection through a bus is used as an example.
- the memory 504 may include a read-only memory and a random access memory, and provide instructions and data to the processor 503. A portion of the memory 504 may also include NVRAM.
- the memory 504 stores an operating system and operation instructions, executable modules or data structures, or a subset thereof, or an extended set thereof, where the operation instructions may include various operation instructions for implementing various operations.
- the operating system may include various system programs for implementing various basic services and processing hardware-based tasks.
- the processor 503 controls the operation of the terminal device, and the processor 503 may also be referred to as a CPU.
- each component of the device for generating a message is coupled together through a bus system.
- the bus system may also include a power bus, a control bus, and a status signal bus.
- various buses are called bus systems in the figure.
- the method disclosed in the above embodiments of the present application may be applied to the processor 503 or implemented by the processor 503.
- the processor 503 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the processor 503 or instructions in the form of software.
- the foregoing processor 503 may be a general-purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component.
- the methods, steps, and logical 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 be any conventional processor or the like.
- the steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied and executed by a hardware decoding processor, or may be executed and completed by a combination of hardware and software modules in the decoding processor.
- the software module may be located in a random storage memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, and other mature storage media in the art.
- the storage medium is located in the memory 504, and the processor 503 reads the information in the memory 504, and completes the steps of the above method in combination with its hardware.
- the receiver 501 can be used to receive input digital or character information, and generate signal input related to user plane device related settings and function control.
- the transmitter 502 can include a display device such as a display screen, and the transmitter 502 can be used to output through an external interface Number or character information.
- the receiver 501 and the transmitter 502 are used to implement data transmission and reception.
- the processor 503 is configured to transmit and receive data through the receiver 501 and the transmitter 502, and complete the result acquisition process performed by the foregoing result acquisition device.
- Embodiments of the present application also provide a computer-readable storage medium for storing program code, and the program code is used to perform any one of the implementation methods in a result acquisition method of the foregoing embodiments.
- Embodiments of the present application also provide a computer program product including instructions that, when run on a computer, cause the computer to execute any one of the method for obtaining a result of the foregoing embodiments.
- the disclosed system, device, and method may be implemented in other ways.
- the device embodiments described above are only schematic.
- the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
- the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical, or other forms.
- the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
- each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
- the above integrated unit can be implemented in the form of hardware or software function unit.
- the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium.
- the technical solution of the present application essentially or part of the contribution to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application.
- the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code .
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
L'invention concerne un procédé, un appareil et un dispositif d'acquisition de résultat permettant de réduire le nombre d'invocations d'une API cible dans un dispositif terminal, réduire une charge de système, et améliorer la performance du système. Le procédé dans les modes de réalisation de la présente invention comprend les étapes suivantes : en réponse à une première instruction de demande pour une API cible, invoquer l'API cible, de façon à acquérir un résultat de retour de l'API cible ; et stocker de manière correspondante l'API cible et le résultat de retour dans un cache. Par conséquent, en réponse à une deuxième instruction de demande pour l'API cible, le résultat de retour correspondant à l'API cible peut être recherché dans le cache, sans devoir invoquer de nouveau l'API cible, afin d'obtenir le résultat de retour de l'API cible, de sorte que le nombre de fois où l'API cible est invoquée est réduit, ce qui réduit la charge de système et améliore la performance du système.
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201811592873.0A CN111367683A (zh) | 2018-12-25 | 2018-12-25 | 一种结果获取方法、装置及设备 |
| CN201811592873.0 | 2018-12-25 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020135485A1 true WO2020135485A1 (fr) | 2020-07-02 |
Family
ID=71126364
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/128240 Ceased WO2020135485A1 (fr) | 2018-12-25 | 2019-12-25 | Procédé, appareil et dispositif d'acquisition de résultat |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN111367683A (fr) |
| WO (1) | WO2020135485A1 (fr) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114785637B (zh) * | 2022-03-15 | 2024-08-09 | 浪潮云信息技术股份公司 | 一种api网关缓存响应数据的实现方法及系统 |
| CN116954936B (zh) * | 2022-04-14 | 2025-09-05 | 华为技术有限公司 | 进程间通信方法和电子设备 |
| CN115061743B (zh) * | 2022-06-08 | 2024-09-27 | Oppo广东移动通信有限公司 | 接口调用方法及装置、计算机可读介质和电子设备 |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1869939A (zh) * | 2005-05-27 | 2006-11-29 | 华为技术有限公司 | 一种多线程应用程序访问数据库的方法 |
| CN102193982A (zh) * | 2011-03-25 | 2011-09-21 | 北京世纪互联工程技术服务有限公司 | 图形数据库联机事务中查询数据的控制方法 |
| CN103645904A (zh) * | 2013-12-20 | 2014-03-19 | 北京京东尚科信息技术有限公司 | 一种接口调用的缓存实现方法 |
| CN103971067A (zh) * | 2014-05-30 | 2014-08-06 | 中国人民解放军国防科学技术大学 | 支持核内外实体的操作系统内核统一访问控制方法 |
| CN104899106A (zh) * | 2014-03-07 | 2015-09-09 | 阿里巴巴集团控股有限公司 | 接口服务异常时的处理方法和装置 |
| US20170097811A1 (en) * | 2015-10-06 | 2017-04-06 | International Business Machines Corporation | Interface method resolution in object oriented programming models |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8914582B1 (en) * | 2011-11-14 | 2014-12-16 | Google Inc. | Systems and methods for pinning content in cache |
| CN104423982B (zh) * | 2013-08-27 | 2018-03-06 | 阿里巴巴集团控股有限公司 | 请求的处理方法和处理设备 |
| CN107707373B (zh) * | 2017-02-21 | 2018-08-17 | 贵州白山云科技有限公司 | 一种基于api请求的动态资源访问加速方法 |
| CN108282405B (zh) * | 2017-12-27 | 2020-09-18 | 好活(昆山)网络科技有限公司 | 应用程序接口缓存管理方法、应用服务器及存储介质 |
-
2018
- 2018-12-25 CN CN201811592873.0A patent/CN111367683A/zh active Pending
-
2019
- 2019-12-25 WO PCT/CN2019/128240 patent/WO2020135485A1/fr not_active Ceased
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1869939A (zh) * | 2005-05-27 | 2006-11-29 | 华为技术有限公司 | 一种多线程应用程序访问数据库的方法 |
| CN102193982A (zh) * | 2011-03-25 | 2011-09-21 | 北京世纪互联工程技术服务有限公司 | 图形数据库联机事务中查询数据的控制方法 |
| CN103645904A (zh) * | 2013-12-20 | 2014-03-19 | 北京京东尚科信息技术有限公司 | 一种接口调用的缓存实现方法 |
| CN104899106A (zh) * | 2014-03-07 | 2015-09-09 | 阿里巴巴集团控股有限公司 | 接口服务异常时的处理方法和装置 |
| CN103971067A (zh) * | 2014-05-30 | 2014-08-06 | 中国人民解放军国防科学技术大学 | 支持核内外实体的操作系统内核统一访问控制方法 |
| US20170097811A1 (en) * | 2015-10-06 | 2017-04-06 | International Business Machines Corporation | Interface method resolution in object oriented programming models |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111367683A (zh) | 2020-07-03 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US12131161B2 (en) | Multi-core communication through a communication layer via a publish-subscribe layer | |
| US10769215B2 (en) | Method, apparatus and computer program product providing an application integrated mobile device search solution using context information | |
| WO2018054195A1 (fr) | Procédé de distribution de ressources et station de base | |
| US20170357735A1 (en) | Information presentation method, device, and system | |
| CN110764688B (zh) | 对数据进行处理的方法和装置 | |
| CN106462635B (zh) | 智能网页内容拦截 | |
| WO2018133297A1 (fr) | Procédé de commande d'affichage de publicité, terminal et serveur de publicités | |
| CN112804160B (zh) | 基于应用程序的限流方法、装置、设备、介质及产品 | |
| WO2020135485A1 (fr) | Procédé, appareil et dispositif d'acquisition de résultat | |
| CN114064712A (zh) | 数据访问方法、装置、电子设备及计算机可读存储介质 | |
| US9185148B1 (en) | Methods and systems for efficient discovery of devices in a peer-to-peer network | |
| CN108519922A (zh) | 信息推送方法及装置、终端设备及计算机可读存储介质 | |
| CN111596864A (zh) | 一种数据延时删除的方法、装置、服务器及存储介质 | |
| CN108809763B (zh) | 一种网络性能参数采集方法、终端装置及存储介质 | |
| CN115774700A (zh) | 文件共享方法、装置、计算机设备及存储介质 | |
| CN113360348A (zh) | 异常请求处理方法、装置、电子设备和存储介质 | |
| US11539776B2 (en) | Method for signaling protocol characteristics for cloud workflow inputs and outputs | |
| CN113342837B (zh) | 数据发送方法、装置、电子设备和计算机可读介质 | |
| CN109766501B (zh) | 爬虫协议管理方法及装置、爬虫系统 | |
| CN119025101A (zh) | 一种业务处理方法、装置、电子设备和存储介质 | |
| WO2023083367A1 (fr) | Procédé et appareil pour reprendre le chargement d'un fichier en arrière-plan, et support de stockage et dispositif électronique | |
| CN104346228A (zh) | 共享应用程序的方法及终端 | |
| CN116339847A (zh) | 一种应用程序冻结方法、装置及电子设备 | |
| CN106804045B (zh) | 一种广播消息的转发控制方法及接入设备 | |
| CN106357764A (zh) | 移动终端的数据同步方法、及服务器 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19904554 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19904554 Country of ref document: EP Kind code of ref document: A1 |