Native call detection method and device, electronic device, and storage medium

By initializing detection of the target native method and delaying the use of calling functions, the H5 page failed to call when JSBridge is not initialized, and the compatibility of native calls in different client environments is improved.

CN116708534BActive Publication Date: 2025-08-19CHINA PING AN LIFE INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310833544.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-07
Publication Date
2025-08-19
Estimated Expiration
2043-07-07

AI Technical Summary

Technical Problem

In project applications in the financial field, when the H5 page needs to use native functions, the JSBridge initialization fails to complete, and the native method of the current banking business version is not compatible on the old version client, resulting in the waiting state or call failure.

Method used

By initializing the target native method to be called, it determines whether it can be executed, and when it detects that support is called by the target client, it starts the preconfigured delayed call function to obtain the result of the delayed call function to determine the call situation.

Benefits of technology

It simplifies the native calling logic, improves the compatibility of native calls, can detect and deal with possible problems in each link, and ensures that native methods are directly called in actual applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116708534B_ABST
    Figure CN116708534B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a native call detection method and device, an electronic device, and a storage medium, which belong to the field of computer technology, wherein the native call detection method includes: initializing detection of the target native method to be called to determine whether the target native method can be executed; when it is detected that the target native method can be executed, detecting whether the target native method can support being called by the target client; when it is detected that the target native method supports being called by the target client, starting a preconfigured delayed call function at the first time node; obtaining the call result of the delayed call function; and determining the call status of the target native method based on the call result of the delayed call function. In the embodiments of the present application, the native call logic can be simplified, and no matter what the specific native method called is, the problems that may arise in each link of the native call can be detected and processed, which is conducive to improving the compatibility of the native call.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a native call detection method and device, an electronic device, and a storage medium. Background Art

[0002] In project applications in the financial field, it is usually necessary to use H5 pages to build business scenarios in order to achieve the integration and analysis of financial data. H5 pages may need to use native functions, such as positioning, user information, etc. Usually, projects are based on JSBridge for communication. JSBridge initialization takes a certain amount of time and does not provide a callback for the completion of initialization. Since it may be necessary to call native methods when just entering the H5 page, if the JSBridge initialization is not completed, the call will fail. In addition, for the banking field, when calling native methods, the native methods added to the business version under the current banking business scenario may not have been implemented in the previous banking business version. Then, when the H5 page runs in the previous client environment or there is no corresponding client environment for the H5 page to run, it will appear in a waiting state and incompatible. Therefore, how to simplify the native call logic and improve the compatibility of native calls has become a technical problem that needs to be solved urgently. Summary of the Invention

[0003] The main purpose of the embodiments of the present application is to propose a native call detection method and device, electronic device, and storage medium, aiming to simplify the native call logic and improve the compatibility of native calls.

[0004] To achieve the above objectives, a first aspect of an embodiment of the present application provides a native call detection method, the method comprising:

[0005] Performing initialization detection on the target native method to be called to determine whether the target native method can be executed;

[0006] In the case of detecting that the target native method can be executed, detecting whether the target native method can support being called by a target client, wherein the target client is a client currently applying the target native method;

[0007] In a case where it is detected that the target native method supports being called by the target client, starting a preconfigured delayed call function at a first time node, wherein the first time node is located after a second time node, and the second time node is a time node for calling the target native method;

[0008] Obtaining the calling result of the delayed calling function;

[0009] The calling status of the target native method is determined according to the calling result of the delayed calling function.

[0010] In some embodiments, determining the calling status of the target native method according to the calling result of the delayed calling function includes:

[0011] When the calling result of the delayed calling function includes a first calling result, it is determined that the target native method call fails, wherein the first calling result indicates that the delayed calling function is called.

[0012] In some embodiments, determining the calling status of the target native method according to the calling result of the delayed calling function includes:

[0013] When the calling result of the delayed calling function includes a second calling result, it is determined that the target native method call is successful, wherein the second calling result indicates that the delayed calling function is not called.

[0014] In some embodiments, the initialization detection of the target native method to be called to determine whether the target native method can be executed includes:

[0015] calling a preset delay function to delay at least one preset time frequency by the preset delay function;

[0016] In the case of delaying at least one of the preset time frequencies, it is determined whether the target native method can be executed.

[0017] In some embodiments, when it is detected that the target native method cannot be executed, the method further includes:

[0018] Obtaining a magnitude relationship between a first detection value and a preset detection threshold, wherein the first detection value is a total number of times initialization detection is performed on the target native method;

[0019] Based on the magnitude relationship between the first detection value and the preset detection threshold, supplementary detection is performed on the target native method.

[0020] In some embodiments, performing supplementary detection on the target native method based on the magnitude relationship between the first detection value and the preset detection threshold includes:

[0021] When the first detection value is greater than the preset detection threshold, determining that the target native method call fails;

[0022] or,

[0023] When the first detection value is less than or equal to the preset detection threshold, the first detection value is increased by one, and the target native method is re-initialized for detection.

[0024] In some embodiments, when it is detected that the target native method does not support being called by the target client, it is determined that the call of the target native method has failed.

[0025] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a native call detection device, the device comprising:

[0026] An initialization detection module is used to perform initialization detection on the target native method to be called to determine whether the target native method can be executed;

[0027] a call detection module, configured to, upon detecting that the target native method can be executed, detect whether the target native method can be called by a target client, wherein the target client is a client currently using the target native method;

[0028] a delayed calling module, configured to, upon detecting that the target native method supports being called by the target client, start a preconfigured delayed calling function at a first time node, wherein the first time node is after a second time node, and the second time node is a time node for calling the target native method;

[0029] A calling acquisition module is used to obtain the calling result of the delayed calling function;

[0030] A call analysis module is used to determine the calling status of the target native method according to the calling result of the delayed calling function.

[0031] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the method described in the first aspect when executing the computer program.

[0032] To achieve the above-mentioned purpose, the fourth aspect of the embodiments of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method described in the first aspect.

[0033] The native call detection method and device, electronic device, and storage medium proposed in this application perform initialization detection on the target native method to be called to determine whether the native call has been initialized. When initialization is detected to be complete, the method further detects whether the client matches the call, and obtains the call result of the pre-configured delayed call function to determine whether a native call delay occurs. This simplifies the native call logic, that is, the native method can be called directly in the actual application scenario. Regardless of the specific native method called, this application can detect and process possible problems in each link of the native call, which is conducive to improving the compatibility of the native call. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 This is a flowchart of a native call detection method provided by an embodiment of the present application;

[0035] Figure 2 yes Figure 1 Flowchart of step S101 in FIG.

[0036] Figure 3 yes Figure 1 A flow chart of step S105 in FIG.

[0037] Figure 4 yes Figure 1 Another flow chart of step S105 in ;

[0038] Figure 5 This is a schematic diagram of the execution flow of a native call detection method provided by an embodiment of the present application;

[0039] Figure 6 This is a flowchart of steps S501 to S502 provided in one embodiment of the present application;

[0040] Figure 7 yes Figure 6 A flow chart of step S502 in FIG.

[0041] Figure 8 yes Figure 6 Another flow chart of step S502 in FIG.

[0042] Figure 9 This is a schematic diagram of the execution flow of initialization detection and supplementary detection in the native call detection method provided by one embodiment of the present application;

[0043] Figure 10 This is a structural diagram of a native call detection device provided by an embodiment of the present application;

[0044] Figure 11 This is a schematic diagram of the hardware structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0046] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.

[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0048] The H5 page needs to use some native functions, such as location information and user information. The project uses JSBridge for communication. First, the initialization of the bridge takes a certain amount of time, and no callback is provided for initialization completion. After that, the native registration method can be called by the H5 page, and the registration method of the H5 page can be called by the native method. However, this usually leads to the following problems:

[0049] First, when entering the H5 page, the native method needs to be called, but the bridge initialization has not been completed at this time, which will cause the call to fail. Although the current solution is to delay the method call for a certain period of time when entering the page, the bridge initialization may still fail at this time due to network conditions and other reasons;

[0050] Secondly, when calling native methods, if the native method is added in the current business version and not implemented in the previous business version, then when the H5 page runs on the old client, a waiting scene will occur;

[0051] Third, during the development phase, since there is no client environment, the H5 page will be in a waiting state when calling native methods.

[0052] Based on this, the embodiments of the present application provide a native call detection method and device, an electronic device, and a storage medium, aiming to simplify the native call logic and improve the compatibility of native calls.

[0053] The native call detection method and device, electronic device, and storage medium provided in the embodiments of the present application are specifically illustrated through the following embodiments. First, the native call detection method in the embodiments of the present application is described.

[0054] The native call detection method provided in the embodiment of the present application relates to the field of computer technology. The native call detection method provided in the embodiment of the present application can be applied to a communication node, can also be applied to a server side, and can also be software running in a communication node or a server side. In some embodiments, the communication node can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or can be configured as a server cluster or a distributed system composed of multiple physical servers, or can be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the native call detection method, etc., but is not limited to the above forms.

[0055] The present application can be used in a variety of general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.

[0056] Figure 1 This is an optional flowchart of the native call detection method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S105.

[0057] Step S101, performing initialization detection on the target native method to be called to determine whether the target native method can be executed;

[0058] Step S102, when it is detected that the target native method can be executed, detecting whether the target native method can be called by a target client, wherein the target client is a client currently using the target native method;

[0059] Step S103: when it is detected that the target native method supports being called by the target client, starting a preconfigured delayed call function at a first time node, wherein the first time node is located after a second time node, and the second time node is a time node for calling the target native method;

[0060] Step S104, obtaining the calling result of the delayed calling function;

[0061] Step S105 : determining the calling status of the target native method according to the calling result of the delayed calling function.

[0062] In steps S101 to S105 shown in the embodiment of the present application, initialization detection is performed on the target native method to be called to determine whether the native call has been initialized. When initialization completion is detected, further detection is performed on the client to determine whether it matches, and by obtaining the call result of the pre-configured delayed call function, it is determined whether a native call delay occurs, thereby simplifying the native call logic, that is, the native method can be called directly in the actual application scenario. Regardless of the specific native method called, the present application can detect and process possible problems in each link of the native call, which is conducive to improving the compatibility of the native call.

[0063] For example, in the banking business field, the target native method to be called is initialized and detected. When it is detected that the target native method can be executed, it is detected whether the target native method can support being called by the target client. If it can support the call, it means that the current business version can support it. Then, when it is detected that the target native method supports being called by the target client, the pre-configured delayed call function is started at a determined time node to further determine the calling status of the target native method.

[0064] It should be noted that the execution subject of the embodiments of the present application is not limited, and those skilled in the art can make corresponding settings according to the specific application scenarios, such as using the control end corresponding to the relevant algorithm, or implementing it based on a preset detection model.

[0065] In step S101 of some embodiments, the purpose of initialization detection is to determine whether the target native method to be called has been initialized so that it can be executed. The specific means and methods can be set according to the specific scenario, which is not limited here. A specific embodiment will be given later for illustration.

[0066] In step S103 of some embodiments, the specific moments of the first time node and the second time node can be set according to the specific application scenario. It is only necessary to ensure that the first time node is after the second time node to realize the delayed call of the delayed call function; the specific type of the pre-configured delayed call function is not limited, for example, the time call function that comes with the Windows environment can be used, etc. This will be further explained in subsequent embodiments and will not be repeated here.

[0067] In step S103 of some embodiments, if it is detected that the target native method does not support being called by the target client, it means that the target native method has not been initialized for loading or reading on the target client at this time, so it can be determined that the target native method call has failed.

[0068] In step S104 and step S105 of some embodiments, the calling result of the delayed calling function is mainly used to reflect whether the delayed calling function can be called, so that the calling status of the target native method can be determined based on the calling status of the delayed calling function.

[0069] See also Figure 2 In some embodiments, step S101 may include but is not limited to steps S201 to S202:

[0070] Step S201, calling a preset delay function to execute delay of at least one preset time frequency through the preset delay function;

[0071] Step S202 : determining whether the target native method can be executed while delaying at least one preset time frequency.

[0072] In this step, the preset delay function is called to execute the delay of at least one preset time frequency. That is to say, in the process of delaying at least one preset time frequency, time is provided for the target native method to be initialized. Then, when the delay is at least one preset time frequency, it is determined whether the target native method can be executed, that is, whether the target native method is initialized. Therefore, by setting the preset delay function to perform the delayed frequency call, the initialization status of the target native method can be detected more effectively.

[0073] In step S201 of some embodiments, there may be multiple types of preset delay functions, such as but not limited to the setTimeout function that comes with the Windows environment, etc., which is not restricted here; at least one preset time frequency, that is, one or more preset time frequencies, is determined based on the actual application scenario, and the value of the preset time frequency is not restricted. In different application scenarios, the value of the preset time frequency can be a corresponding value.

[0074] See also Figure 3 In some embodiments, step S105 may include but is not limited to step S301:

[0075] Step S301 : When the calling result of the delayed calling function includes a first calling result, it is determined that the target native method call fails, wherein the first calling result indicates that the delayed calling function is called.

[0076] In this step, when the call result of the delayed call function is the first call result, it can be determined that the delayed call function is called, which means that the call of the target native method has not returned a result. In other words, a delayed call will only be made when the call of the target native method has not returned a result. Therefore, the failure of the target native method call can be indirectly and accurately determined through the first call result.

[0077] In step S301 of some embodiments, the specific presentation manner of the first call result may be various, such as but not limited to result display information, etc., which is not limited here.

[0078] See also Figure 4 In some embodiments, step S105 may include but is not limited to step S401:

[0079] Step S401 : When the calling result of the delayed calling function includes a second calling result, it is determined that the target native method is called successfully, wherein the second calling result indicates that the delayed calling function is not called.

[0080] In this step, when the call result of the delayed call function is the second call result, it can be determined that the delayed call function has not been called, which means that the call of the target native method has returned a result. In this case, no delayed call will be made. In other words, the delayed call will only be made when the call of the target native method does not return a result. Therefore, the second call result can be used to indirectly and accurately determine that the target native method call is successful.

[0081] In step S401 of some embodiments, the specific presentation manner of the second call result may be various, such as but not limited to result display information, etc., which is not limited here.

[0082] In order to better illustrate the working principles and contents of the above embodiments, a specific example is given below for illustration.

[0083] Example 1:

[0084] like Figure 5 As shown, Figure 5 This is a schematic diagram of the execution flow of the native call detection method provided by an embodiment of the present application.

[0085] See also Figure 5 , perform the following steps related to the native call detection method:

[0086] First, the initialization detection process is entered. If the initialization detection is successful, the version determination process is entered, that is, whether the client supports the call. Conversely, if the initialization detection fails, it is determined that the target native method call has failed;

[0087] Then, the version determination process is entered to determine whether the current version of the client supports the call of the target native method. If it does, the timeout detection process is entered. Otherwise, it is determined that the call of the target native method has failed.

[0088] Then, the timeout detection process begins. When calling the target native method, a fixed-time delayed call function is started first. For example, using the characteristics of the Promise object, the resolve function / reject function of the Promise object can only be called once, and subsequent calls will not take effect. When the target native method is called, if the normal function call of the target native method returns first, and the resolve function / reject function is called based on the returned function, then due to the arrival of subsequent delayed calls, the execution of the reject function will not take effect. On the contrary, due to the non-existence of the target native method, or the development and debugging on the browser, the waiting time is too long, etc., the function call will not return normally, and a delayed call will be entered, and the result of the target native method call failure will be returned.

[0089] It can be seen that after entering the detection page, the business caller does not need to worry about whether JSBridge is initialized. It can directly call the corresponding target native method, and the detection party will perform initialization detection and method call internally, which is conducive to greatly simplifying the calling logic. At the same time, it can handle compatibility issues such as unsupported native version, non-existent native method, wrong method name, and method call timeout during business calls, which is conducive to improving compatibility. In addition, relevant processing has been carried out for issues such as initialization timeout and method call timeout, achieving safe processing.

[0090] See also Figure 6 In some embodiments, when it is detected that the target native method cannot be executed, the native call detection method may further include but is not limited to steps S501 to S502:

[0091] Step S501: Obtaining a magnitude relationship between a first detection value and a preset detection threshold, wherein the first detection value is the total number of times initialization detection is performed on the target native method;

[0092] Step S502 : performing supplementary detection on the target native method based on the magnitude relationship between the first detection value and the preset detection threshold.

[0093] In this step, the total number of times the target native method is initialized is counted to determine the overall situation of the target native method initialization detection, so as to compare the total number with the preset detection threshold to determine whether the effect of the initialization detection has met expectations, and to perform additional detection on the target native method based on the expected situation.

[0094] In steps S501 and S502 of some embodiments, generally speaking, the first detection value should be greater than one, that is, at least two initialization detections are required; the preset detection threshold can be set accordingly according to the specific application scenario and is not limited here.

[0095] See also Figure 7 In some embodiments, step S502 is further described. Step S502 may include but is not limited to step S601:

[0096] Step S601: When the first detection value is greater than a preset detection threshold, it is determined that the target native method call fails.

[0097] In this step, when the first detection value is greater than the preset detection threshold, it means that initialization detection has been performed multiple times but it is still impossible to determine that the initialization detection is successful. Therefore, there is no need to perform initialization detection again. At the same time, it can be determined that the target native method call failed. That is to say, by judging that the first detection value is greater than the preset detection threshold, the calling status of the target native method can be determined well and accurately.

[0098] See also Figure 8 In some embodiments, step S502 is further described. Step S502 may include but is not limited to step S701:

[0099] Step S701: When the first detection value is less than or equal to the preset detection threshold, the first detection value is increased by one, and the target native method is re-initialized for detection.

[0100] In this step, when the first detection value is less than or equal to the preset detection threshold, it means that the number of initialization detections has not reached the expected number, and initialization detection needs to be performed again. Therefore, the updated first detection value can be recorded, and the target native method can be re-initialized and detected again. In other words, by judging whether the first detection value is less than or equal to the preset detection threshold, the calling status of the target native method can be determined well and accurately.

[0101] In step S701 of some embodiments, the method of re-initializing the target native method is the same as the specific method of step S101 in the aforementioned embodiment, and is not repeated here.

[0102] In order to better illustrate the working principles and contents of the above embodiments, a specific example is given below for illustration.

[0103] Example 2:

[0104] See also Figure 9 , shows a schematic diagram of the execution flow of initialization detection and supplementary detection in the native call detection method of an embodiment of the present application.

[0105] Use the initialization heartbeat detection method for detection. The steps are as follows:

[0106] First, perform the initialization detection delay and call the setTimeout function that comes with the Window environment. The execution delays a fixed time frequency and then enters the process of detecting whether the initialization is successful.

[0107] Then, check whether the initialization is successful by judging whether there is a corresponding JSBridge execution method in the global world. If the execution method is detected, it is determined that the initialization has been successful; otherwise, it enters the judgment process of whether it is a heartbeat cycle;

[0108] Then, determine whether it is within the heartbeat cycle by judging whether the current detection number is greater than the maximum detection number. If it exceeds the maximum detection number, it is determined that the initialization has failed; otherwise, the current detection number is increased by one in the detection function, and the initialization detection delay process is re-entered.

[0109] It can be seen that by adopting the above example method, after entering the detection page, the business caller does not need to worry about whether JSBridge is initialized. It can directly call the corresponding target native method, and the detection party will perform initialization detection and method call on it internally, which helps to greatly simplify the calling logic.

[0110] See also Figure 10 , an embodiment of the present application further provides a native call detection device that can implement the above-mentioned native call detection method, the device comprising:

[0111] The initialization detection module is used to perform initialization detection on the target native method to be called to determine whether the target native method can be executed;

[0112] A call detection module is used to detect whether the target native method can be called by a target client when it is detected that the target native method can be executed, wherein the target client is a client currently using the target native method;

[0113] a delayed call module, configured to, upon detecting that the target native method supports being called by the target client, start a preconfigured delayed call function at a first time node, wherein the first time node is located after a second time node, and the second time node is a time node for calling the target native method;

[0114] The call acquisition module is used to obtain the call result of the delayed call function;

[0115] The call analysis module is used to determine the calling status of the target native method based on the calling results of the delayed calling function.

[0116] The specific implementation of the native call detection device is basically the same as the specific embodiment of the above-mentioned native call detection method, and belongs to the same inventive concept, so it will not be repeated here.

[0117] The present application also provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-described native call detection method when executing the computer program. The electronic device can be any intelligent communication node, such as a tablet computer or an in-vehicle computer.

[0118] See also Figure 11 , Figure 11 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes:

[0119] The processor 901 can be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.

[0120] Memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). Memory 902 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in memory 902, and the processor 901 calls and executes the native call detection method of the embodiments of this application.

[0121] Input / output interface 903, used to implement information input and output;

[0122] Communication interface 904, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);

[0123] Bus 905 , which transmits information between various components of the device (e.g., processor 901 , memory 902 , input / output interface 903 , and communication interface 904 );

[0124] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .

[0125] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned native call detection method.

[0126] Memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, memory can include high-speed random access memory and can also include non-transient memory, such as at least one disk storage device, flash memory device, or other non-transient solid-state memory device. In some embodiments, memory can optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0127] The native call detection method and device, electronic device, and storage medium provided in the embodiments of the present application perform initialization detection on the target native method to be called to determine whether the native call has been initialized. When initialization is detected to be complete, the method further detects whether the client matches the call, and obtains the call result of the pre-configured delayed call function to determine whether a native call delay occurs. This simplifies the native call logic, that is, the native method can be called directly in the actual application scenario. Regardless of the specific native method called, the present application can detect and process possible problems in each link of the native call, which is conducive to improving the compatibility of the native call.

[0128] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0129] The foregoing description describes specific embodiments of the present application, and other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in an order different from that described in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0130] The various embodiments in this application are described in a progressive manner. Similar portions between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the device, equipment, and computer-readable storage medium embodiments are generally similar to the method embodiments, so their descriptions are relatively simple. For relevant portions, refer to the descriptions of the method embodiments.

[0131] The apparatus, device, computer-readable storage medium and method provided in the embodiments of the present application correspond to each other. Therefore, the apparatus, device and non-volatile computer storage medium also have similar beneficial technical effects as the corresponding method. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the corresponding apparatus, device and computer storage medium will not be repeated here.

[0132] In the 1990s, improvements to a technology could be clearly distinguished between hardware improvements (for example, improvements to circuit structures such as diodes, transistors, and switches) and software improvements (improvements to process flows). However, with the advancement of technology, many process flow improvements today can be considered direct improvements to hardware circuit structures. Designers almost always create the corresponding hardware circuit structure by programming the improved process flow into the hardware circuit. Therefore, it cannot be said that a process flow improvement cannot be implemented using hardware modules.

[0133] For example, a programmable logic device (PLD), such as a field programmable gate array (FPGA), is an integrated circuit whose logic functions are determined by user programming. Designers can integrate a digital system onto a PLD by programming themselves, eliminating the need for a chip manufacturer to design and fabricate a dedicated integrated circuit chip. Furthermore, these days, instead of manually fabricating integrated circuit chips, this programming is often performed using software called a logic compiler. This software is similar to the software compilers used when developing programs. Before compilation, the original code must be written in a specific programming language, called a hardware description language (HDL). There are many different types of HDL, such as:

[0134] ABEL (Advanced Boolean Expression Language); AHDL (Altera Hardware Description Language); Confluence; CUPL (Cornell University Programming Language); HDCal; and JHDL (Java Hardware Description Language); Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. Currently, VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog are more commonly used in this field. It should be clear to those skilled in the art that by simply programming the method flow in the aforementioned hardware description languages and programming it into an integrated circuit, a hardware circuit that implements the logical method flow can be easily obtained.

[0135] The controller may be implemented in any suitable manner. For example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers:

[0136] ARC 625D, Atmel AT91SAM, Microchip IP address PIC18F26K20 and Silicon Labs C8051F320, the memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also know that in addition to implementing the controller in a purely computer-readable program code format, it is entirely possible to implement the same function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules for implementing the method and structures within the hardware component.

[0137] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0138] For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing the embodiments of the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0139] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the embodiments of the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0140] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0141] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0142] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0143] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0144] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0145] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.

[0146] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0147] In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can represent: a, b, c, a and b, a and c, b and c or a and b and c, where a, b, c can be single or multiple.

[0148] Embodiments of the present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. Embodiments of the present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0149] The various embodiments in this application are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiment is generally similar to the method embodiment, so the description is relatively simple. For relevant parts, refer to the partial description of the method embodiment.

[0150] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included within the scope of the claims of the present application.

Claims

1. A native call detection method, characterized in that: include: Performing initialization detection on the target native method to be called to determine whether the target native method can be executed; In the case of detecting that the target native method can be executed, detecting whether the target native method can support being called by a target client, wherein the target client is a client currently applying the target native method; In a case where it is detected that the target native method supports being called by the target client, starting a preconfigured delayed call function at a first time node, wherein the first time node is located after a second time node, and the second time node is a time node for calling the target native method; Obtaining the calling result of the delayed calling function; The calling status of the target native method is determined according to the calling result of the delayed calling function.

2. The native call detection method according to claim 1, characterized in that: The determining, according to the calling result of the delayed calling function, the calling status of the target native method includes: When the calling result of the delayed calling function includes a first calling result, it is determined that the target native method call fails, wherein the first calling result indicates that the delayed calling function is called.

3. The native call detection method according to claim 1, characterized in that: The determining, according to the calling result of the delayed calling function, the calling status of the target native method includes: When the calling result of the delayed calling function includes a second calling result, it is determined that the target native method call is successful, wherein the second calling result indicates that the delayed calling function is not called.

4. The native call detection method according to claim 1, characterized in that: The initialization detection of the target native method to be called to determine whether the target native method can be executed includes: calling a preset delay function to delay at least one preset time frequency by the preset delay function; In the case of delaying at least one of the preset time frequencies, it is determined whether the target native method can be executed.

5. The native call detection method according to claim 1 or 4, characterized in that: In the case where it is detected that the target native method cannot be executed, the method further includes: Obtaining a magnitude relationship between a first detection value and a preset detection threshold, wherein the first detection value is a total number of times initialization detection is performed on the target native method; Based on the magnitude relationship between the first detection value and the preset detection threshold, supplementary detection is performed on the target native method.

6. The native call detection method according to claim 5, characterized in that: The performing supplementary detection on the target native method according to the magnitude relationship between the first detection value and the preset detection threshold includes: When the first detection value is greater than the preset detection threshold, determining that the target native method call fails; or, When the first detection value is less than or equal to the preset detection threshold, the first detection value is increased by one, and the target native method is re-initialized for detection.

7. The native call detection method according to claim 1, characterized in that: In a case where it is detected that the target native method does not support being called by the target client, it is determined that the call of the target native method fails.

8. A native call detection device, characterized in that: The device comprises: An initialization detection module is used to perform initialization detection on the target native method to be called to determine whether the target native method can be executed; a call detection module, configured to, upon detecting that the target native method can be executed, detect whether the target native method can be called by a target client, wherein the target client is a client currently using the target native method; a delayed calling module, configured to, upon detecting that the target native method supports being called by the target client, start a preconfigured delayed calling function at a first time node, wherein the first time node is after a second time node, and the second time node is a time node for calling the target native method; A calling acquisition module is used to obtain the calling result of the delayed calling function; A call analysis module is used to determine the calling status of the target native method according to the calling result of the delayed calling function.

9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the native call detection method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the native call detection method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Frequency modulation method, frequency modulation device, storage medium and electronic equipment

    CN110647401A

  • Method and device for calling native application by HTML5 application

    CN110704131A