Browser compatibility detection method, device, equipment and readable storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WEBANK (CHINA)
- Filing Date
- 2019-10-24
- Publication Date
- 2026-08-07
AI Technical Summary
两种方式的兼容性均较差,其中,第(1)种方式只能支持PC(Personal Computer,个人计算机)端中某些特定类型和版本的浏览器,对移动端(如iOS系统和安卓系统的手机)都不支持;第(2)种方式的兼容性比第(1)种方式稍好,可支持iOS(由苹果公司开发的移动操作系统)系统,但对Android(安卓)系统的部分浏览器不支持
[0043] This invention provides a method, apparatus, device, and readable storage medium for detecting browser compatibility. When the system detects that the current browser has started video recording, it obtains first target information through a preset interface of the current browser; then, it parses the first target information to obtain first parameter information; subsequently, it matches the first parameter information with a preset list of incompatible browsers to obtain a matching result, and determines whether the current browser is incompatible based on the matching result. Through this method, intelligent detection of browser compatibility can be achieved, promptly detecting whether the browser supports video recording. If the browser does not support video recording, the user is promptly reminded to switch browsers, preventing users from getting stuck in the video recording process and unable to complete the entire operation, thus improving the user experience.
Smart Images

Figure CN110750460B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of financial technology (Fintech), and more particularly to a method, apparatus, device, and readable storage medium for detecting browser compatibility. Background Technology
[0002] With the development of computer technology, more and more technologies (big data, distributed systems, blockchain, artificial intelligence, etc.) are being applied in the financial field. The traditional financial industry is gradually transforming into financial technology (Fintech). However, due to the security and real-time requirements of the financial industry, higher demands are also being placed on technology.
[0003] Currently, many web pages provide video recording functionality. When calling the camera to record video on a web page, the following two methods are commonly used: (1) Use the getUserMedia API (User Media Acquisition Interface) to read camera data, and then use the MediaRecorder API (Media Recording Interface) to record and save the video data to the device; (2) Use the input tag to invoke the camera for video recording. Both methods have poor compatibility. Method (1) only supports certain types and versions of browsers on PCs (Personal Computers) and does not support mobile devices (such as iOS and Android phones). Method (2) has slightly better compatibility than method (1) and supports iOS (Apple's mobile operating system), but does not support some browsers on Android.
[0004] In unsupported browsers, clicking the video recording button has no effect, and the browser doesn't inform the user of any incompatibility, causing the user to get stuck in the video recording process and unable to complete the entire operation. Therefore, there is an urgent need for a browser compatibility detection method to promptly detect whether a browser supports video recording functionality, and then promptly remind the user to switch to a different browser if it is not supported. Summary of the Invention
[0005] The main objective of this invention is to provide a method, apparatus, device, and readable storage medium for detecting browser compatibility, aiming to achieve intelligent detection of browser compatibility and timely detect whether a browser supports video recording functionality.
[0006] To achieve the above objectives, the present invention provides a browser compatibility detection method, the browser compatibility detection method comprising:
[0007] When the current browser is detected to have started video recording, the first target information is obtained through the current browser's preset interface;
[0008] The first target information is parsed to obtain the first parameter information;
[0009] The first parameter information is matched with a preset list of incompatible browsers to obtain a matching result. Based on the matching result, it is determined whether the current browser is an incompatible browser.
[0010] Optionally, the step of parsing the first target information to obtain the first parameter information includes:
[0011] The preset keywords are matched with the first target information to obtain the system type and browser name corresponding to the current browser;
[0012] The parameters to be matched are determined based on the system type and the browser name, and the keywords to be matched are determined based on the browser name, the parameters to be matched, and the preset mapping relationship.
[0013] The keyword to be matched is matched with the first target information to obtain the matching parameter information corresponding to the matching parameter, wherein the first parameter information includes system type, browser name and matching parameter information.
[0014] Optionally, the step of determining the parameters to be matched based on the system type and the browser name includes:
[0015] Determine whether the current browser is the system browser or a third-party browser based on the browser name;
[0016] If the current browser is a third-party browser, then the parameter to be matched is determined to be the browser version number;
[0017] If the current browser is the system browser, then detect whether the system type is iOS or Android.
[0018] If the system type is iOS, then the parameter to be matched is determined to be the browser version number;
[0019] If the system type is Android, then the parameters to be matched are determined to be the browser kernel and version number, browser version number, system version number, and device brand.
[0020] Optionally, the browser compatibility detection method further includes:
[0021] Receive the second target information obtained from testing with incompatible browsers, sent by the test terminal;
[0022] The second target information is parsed to obtain the second parameter information;
[0023] The preset list of incompatible browsers is generated based on the second parameter information.
[0024] Optionally, the browser compatibility detection method further includes:
[0025] After receiving the initial report from the user's browser, monitor whether a second report from the user's browser is received within a first preset time.
[0026] If no secondary reporting information is received from the user's browser within the first preset time, the third parameter information corresponding to the user's browser is obtained and stored in the preset database.
[0027] Periodically retrieve third parameter information from the preset database within a second preset time period, perform statistics, and determine a list of suspected incompatible browsers based on the statistical results;
[0028] The list of suspected incompatible browsers is sent to a preset test terminal so that the preset test terminal can detect whether there are any incompatible browsers in the list of suspected incompatible browsers;
[0029] Receive the detection results returned by the preset test terminal, and update the preset list of incompatible browsers based on the detection results.
[0030] Optionally, after the step of determining whether the current browser is an incompatible browser based on the matching result, the method further includes:
[0031] If the current browser is determined to be incompatible, a prompt to switch to a different browser will be generated and displayed in the current browser.
[0032] Optionally, before the step of generating the browser switching prompt and displaying the prompt in the current browser, the method further includes:
[0033] Determine whether the current browser is a self-developed browser based on the browser name;
[0034] If the current browser is not a self-developed browser, then perform the following steps: generate a prompt message to switch browsers and display the prompt in the current browser;
[0035] If the current browser is a self-developed browser, then obtain the corresponding compatibility solution based on the system type.
[0036] Based on the aforementioned compatibility solution, a corresponding solution prompt message is generated and displayed in the current browser.
[0037] Furthermore, to achieve the above objectives, the present invention also provides a browser compatibility detection device, the browser compatibility detection device comprising:
[0038] The first acquisition module is used to acquire first target information through the preset interface of the current browser when the video recording function of the current browser is detected to be started.
[0039] The first parsing module is used to parse the first target information to obtain the first parameter information;
[0040] The list matching module is used to match the first parameter information with a preset list of incompatible browsers to obtain a matching result, and determine whether the current browser is an incompatible browser based on the matching result.
[0041] Furthermore, to achieve the above objectives, the present invention also provides a browser compatibility detection device, which includes: a memory, a processor, and a browser compatibility detection program stored in the memory and executable on the processor. When the browser compatibility detection program is executed by the processor, it implements the steps of the browser compatibility detection method described above.
[0042] In addition, to achieve the above objectives, the present invention also provides a readable storage medium storing a browser compatibility detection program, which, when executed by a processor, implements the steps of the browser compatibility detection method as described above.
[0043] This invention provides a method, apparatus, device, and readable storage medium for detecting browser compatibility. When the system detects that the current browser has started video recording, it obtains first target information through a preset interface of the current browser; then, it parses the first target information to obtain first parameter information; subsequently, it matches the first parameter information with a preset list of incompatible browsers to obtain a matching result, and determines whether the current browser is incompatible based on the matching result. Through this method, intelligent detection of browser compatibility can be achieved, promptly detecting whether the browser supports video recording. If the browser does not support video recording, the user is promptly reminded to switch browsers, preventing users from getting stuck in the video recording process and unable to complete the entire operation, thus improving the user experience. Attached Figure Description
[0044] Figure 1 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of the present invention;
[0045] Figure 2 This is a flowchart illustrating the first embodiment of the browser compatibility detection method of the present invention;
[0046] Figure 3 This is a schematic diagram of the functional modules of the first embodiment of the browser compatibility detection device of the present invention.
[0047] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0048] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0049] Reference Figure 1 , Figure 1 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of the present invention.
[0050] The browser compatibility testing device in this embodiment of the invention can be a smartphone, or a PC (Personal Computer), tablet computer, portable computer, or other terminal device.
[0051] like Figure 1 As shown, the browser compatibility testing device may include: a processor 1001, such as a CPU; a communication bus 1002; a user interface 1003; a network interface 1004; and a memory 1005. The communication bus 1002 is used to establish communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0052] Those skilled in the art will understand that Figure 1 The browser compatibility testing device structure shown does not constitute a limitation on the browser compatibility testing device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0053] like Figure 1 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a browser compatibility detection program.
[0054] exist Figure 1In the terminal shown, the network interface 1004 is mainly used to connect to the backend server and communicate data with the backend server; the user interface 1003 is mainly used to connect to the client and communicate data with the client; and the processor 1001 can be used to call the browser compatibility detection program stored in the memory 1005 and execute the various steps of the browser compatibility detection method.
[0055] Based on the above hardware structure, various embodiments of the browser compatibility detection method of the present invention are proposed.
[0056] This invention provides a method for detecting browser compatibility.
[0057] Reference Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the browser compatibility detection method of the present invention.
[0058] In this embodiment, the browser compatibility detection method includes:
[0059] Step S10: When it is detected that the current browser has started the video recording function, the first target information is obtained through the preset interface of the current browser;
[0060] The browser compatibility detection method in this embodiment is implemented by a browser compatibility detection device, which is illustrated using a web front-end server as an example. In this embodiment, when a user clicks the video recording button in the current browser on the user's end, the current browser, while starting the video recording function, sends a report message to the web front-end server to inform the web front-end server that it has started the video recording function. At this time, when the web front-end server detects that the current browser has started the video recording function, it obtains the first target information through the current browser's preset interface. The preset interface is the navigator API, and the first target information is the current browser's userAgent information. Of course, it is understood that in a specific embodiment, the triggering time for the step of "obtaining the first target information through the current browser's preset interface" could also be when the current browser is detected to be started, or after receiving the initial report message from the current browser, but before receiving a second report message from the current browser within a first preset time, etc.
[0061] Step S20: Parse the first target information to obtain the first parameter information;
[0062] After obtaining the first target information, the first target information is parsed to obtain the first parameter information. Specifically, step S20 includes:
[0063] Step a1: Match the preset keywords with the first target information to obtain the system type and browser name corresponding to the current browser;
[0064] First, the preset keywords are matched with the first target information to obtain the system type and browser name corresponding to the current browser. The preset keywords include preset system keywords and preset browser keywords. System keywords include, but are not limited to, iPhone, iPad, iPod, and Android. Preset browser keywords can be the English names or abbreviations of various browsers, such as Safari, UC Browser, and Baidu Browser.
[0065] During the matching process, the system type can be determined based on the matching results between preset system keywords and the first target information. For example, if "iPhone," "iPad," or "iPod" is matched from the first target information based on the preset system keywords, the system type can be determined to be iOS (a mobile operating system developed by Apple Inc.); if "Android" is matched from the first target information, the system type can be determined to be Android. The browser name can be determined based on the matching results between preset browser keywords and the first target information. For example, if "safari" is matched from the first target information based on the preset browser keywords, the browser name is safari.
[0066] Step a2: Determine the parameters to be matched based on the system type and the browser name, and determine the keywords to be matched based on the browser name, the parameters to be matched, and the preset mapping relationship;
[0067] After obtaining the system type and browser name, the parameters to be matched are determined based on the system type and browser name, and the keywords to be matched are determined based on the browser name, the parameters to be matched, and the preset mapping relationship. The preset mapping relationship includes the mapping relationship between the browser name, the parameters to be matched, and the keywords to be matched.
[0068] The step "Determine the parameters to be matched based on the system type and the browser name" includes:
[0069] Step a21: Determine whether the current browser is the system browser or a third-party browser based on the browser name;
[0070] Step a22: If the current browser is a third-party browser, then determine the parameter to be matched as the browser version number;
[0071] Step a23: If the current browser is a system browser, then detect whether the system type is iOS or Android.
[0072] Step a231: If the system type is iOS, then the parameter to be matched is determined to be the browser version number;
[0073] Step a232: If the system type is Android, then the parameters to be matched are determined to be browser kernel and version number, browser version number, system version number, and device brand.
[0074] The process of determining the parameters to be matched is as follows: First, determine whether the current browser is a system browser or a third-party browser based on the browser name. Specifically, a list of common browsers can be pre-defined, including browser name and browser type. Browser type includes system browsers and third-party browsers. For example, Safari on iPhone, Xiaomi Browser (a browser for Xiaomi phones), and Huawei Browser (a browser for Huawei phones) are set as system browsers; UC Browser, Baidu Browser, etc., are set as third-party browsers. Then, determine whether the current browser is a system browser based on the browser name and the pre-defined list of common browsers.
[0075] If the current browser is determined to be a third-party browser, then the parameter to be matched is the browser version number. This is because: when a user uses a third-party browser app on an iOS mobile device, if the third-party browser app requests permission to use the camera and microphone, the info.plist file (used to provide some configurations for the application at runtime) in the app's code project will contain the following code:
[0076] .NS Microphone Usage Description
[0077] .NSCameraUsageDescription
[0078] Using the `<input>` tag in a third-party browser's web page will normally invoke the system camera for taking pictures. However, if the third-party browser app does not have camera and microphone permissions, and the `info.plist` file does not contain the two lines of code mentioned above, calling the `<input>` tag in the web page will cause the third-party browser app to crash. Currently, it is impossible to directly detect whether a browser app has requested camera and microphone permissions. Experiments have shown that if a certain version of a third-party browser app does not request camera and microphone permissions, causing the app to crash, then all iOS devices with the same type and version of third-party browser apps will also experience crashes, because the installation package is the same, and therefore the app code is identical. In other words, third-party browser apps of the same type and version behave consistently on different phones. Therefore, after obtaining the system type and determining that it is a third-party browser based on the browser name, the parameters to be parsed (i.e., the parameters to be matched) only need to include the browser version.
[0079] If the current browser is determined to be a system browser, then the parameters to be matched need to be further determined based on the system type. Specifically, it is necessary to detect whether the system type is iOS or Android. If the system type is iOS, then the parameters to be matched are determined to be the browser version number; if the system type is Android, then the parameters to be matched are determined to be the browser kernel and version number, the browser version number, the system version number, and the device brand.
[0080] It should be noted that if the current browser is the system browser and the system type is iOS, it is not necessary to determine the parameters to be matched. The browser name and system type can be used as the first parameter information to match with the preset list of incompatible browsers.
[0081] Furthermore, it should be noted that if the current browser is a system browser and the system type is Android, then the parameters to be matched are the browser kernel and version number, browser version number, system version number, and device brand. This is because: currently, each mobile phone manufacturer has its own Android system, such as Xiaomi's MIUI and Huawei's EMUI. Different mobile device manufacturers' Android systems will make some personalized modifications to the system browser kernel. Therefore, when using an Android system browser to access web pages for video recording, it will be related to the Android phone's ROM (Read-Only Memory) package version. Phones using the same ROM package will have consistent system browser performance. However, currently, it is not possible to directly obtain the relevant information of the phone's ROM package, so direct comparison is not possible. By parsing the first target information (i.e., userAgent information), information such as the browser kernel and version number, browser software name and version number, Android system version number, device brand, device number, and device language can be obtained. This requires comparing the browser kernel and version number, browser software name and version number, Android system version number, and device brand. Because the same ROM package installed on different devices will ensure these parameters are consistent, and Android devices of the same brand will use the same manufacturer's ROM package, the device brand is also a crucial comparison factor. Therefore, after obtaining the system type and identifying the browser as a third-party browser based on its name, the parameters to be parsed (i.e., the parameters to be matched) must also include the browser kernel and version number, browser version number, system version number, and device brand.
[0082] Step a3: Match the keyword to be matched with the first target information to obtain the matching parameter information corresponding to the matching parameter, wherein the first parameter information includes system type, browser name and matching parameter information.
[0083] After determining the keyword to be matched, the keyword to be matched is matched with the first target information to obtain the matching parameter information corresponding to the matching parameter. The first parameter information includes system type, browser name and matching parameter information.
[0084] Step S30: Match the first parameter information with a preset list of incompatible browsers to obtain a matching result, and determine whether the current browser is an incompatible browser based on the matching result.
[0085] After parsing and obtaining the first parameter information, the first parameter information is matched with a preset list of incompatible browsers to obtain the matching result. Based on the matching result, it is determined whether the current browser is an incompatible browser. The preset list of incompatible browsers is pre-established, and its specific creation process can be referred to the second embodiment below, which will not be repeated here. It should be noted that since the compatibility of the same browser varies on different terminals, and different versions of the same browser can also affect compatibility, the preset list of incompatible browsers does not only include the browser name, but may also include information such as system type, browser version, browser kernel and version number, system version number, and device brand.
[0086] This invention provides a browser compatibility detection method. When the current browser is detected to have started video recording, first target information is obtained through a preset interface of the current browser. The first target information is then parsed to obtain first parameter information. This first parameter information is then matched against a preset list of incompatible browsers to obtain a matching result. Based on the matching result, it is determined whether the current browser is incompatible. This method enables intelligent browser compatibility detection, promptly identifying whether a browser supports video recording. If a browser does not support video recording, the user is promptly reminded to switch browsers, preventing users from getting stuck in the video recording process and thus improving the user experience.
[0087] Furthermore, based on the first embodiment described above, a second embodiment of the browser compatibility detection method of the present invention is proposed.
[0088] In this embodiment, before step S10, the browser compatibility detection method further includes:
[0089] Step A: Receive the second target information obtained from testing with incompatible browsers sent by the test terminal;
[0090] This embodiment provides a process for generating a pre-defined list of incompatible browsers. Specifically, testers can install various types and versions of browsers on different system test clients, then open a pre-defined webpage in the browser, click the video recording button, and check for crashes. If a crash occurs, the browser is considered incompatible. Alternatively, if clicking the record button has no effect and does not enter the recording process, the browser is also considered incompatible. In this case, second target information is obtained through the browser's pre-defined interface (the navigator API), where the second target information is the userAgent information of the incompatible browser. Then, the second target information is sent to the web front-end server, which receives the second target information obtained from the incompatible browser test from the test client.
[0091] Step B: Parse the second target information to obtain the second parameter information;
[0092] Step C: Generate the preset list of incompatible browsers based on the second parameter information.
[0093] Then, the second target information is parsed to obtain the second parameter information. The specific parsing process is consistent with the process of resolving the first parameter information, and can be referred to the first embodiment described above, which will not be repeated here. After obtaining the second parameter information, a preset list of incompatible browsers is generated based on the second parameter information.
[0094] By using the above method to pre-build a list of incompatible browsers, it is easy to detect whether the user's browser is compatible. In this way, the user can be promptly reminded when the browser is incompatible, thus preventing the user from getting stuck in the video recording stage and unable to complete the entire operation process.
[0095] Furthermore, since the installation packages for many historical versions of browsers are no longer available, it is impossible to completely identify all unsupported browsers through self-testing. In other words, a pre-set list of incompatible browsers cannot guarantee comprehensiveness. Meanwhile, system browsers from manufacturers and third-party browsers are constantly being updated, and new browsers and mobile phones are constantly entering the market. Testing all browsers is costly, necessitating a low-cost method that can continuously update the list of incompatible browsers. Therefore, based on the first and second embodiments described above, a third embodiment of the browser compatibility detection method of the present invention is proposed.
[0096] In this embodiment, the browser compatibility detection method further includes:
[0097] Step D: After receiving the initial report from the user's browser, monitor whether a second report from the user's browser is received within a first preset time.
[0098] In this embodiment, when a user clicks the video recording button in their browser, the browser sends a report to the web front-end server to initiate video recording, along with the current user ID and browser version number. Upon receiving the recorded video, the browser again reports the current user ID and the recorded video. In other words, if the browser supports video recording, the web front-end server receives two reports after initiating recording: the initial report (the aforementioned current user ID and browser version number) and the secondary report (the aforementioned current user ID and the recorded video). Therefore, by detecting whether a secondary report is received within a first preset time after receiving the initial report, potentially incompatible browsers can be identified. Further testing and confirmation of these browsers can then update the preset list of incompatible browsers. Specifically, after receiving the initial report from the user's browser, the system monitors whether a secondary report is received within a first preset time. This first preset time can be set according to actual needs and is not specifically limited here.
[0099] Step E: If no secondary reporting information is received from the user's browser within the first preset time, then the third parameter information corresponding to the user's browser is obtained and stored in the preset database.
[0100] If no secondary reporting information is received from the user's browser within a first preset time period, the third parameter information corresponding to the user's browser is obtained and stored in a preset database. That is, the third target information is obtained through the user's browser's preset interface (the navigator API), and then parsed to obtain the third parameter information. The specific parsing process is consistent with the process for resolving the first parameter information, and can be referred to the first embodiment described above, which will not be repeated here.
[0101] Step F: Periodically retrieve the third parameter information within a second preset time period from the preset database, perform statistics, and determine a list of suspected incompatible browsers based on the statistical results;
[0102] Then, the third parameter information within a second preset time period is periodically retrieved from the preset database and statistically analyzed. Based on the statistical results, a list of suspected incompatible browsers is determined. The periodicity can be set to every week or month, and the corresponding second preset time period can be set to one week or one month from the current time. When statistically analyzing the third parameter information within the second preset time period, the number of times each type and version of browser failed to report again in different systems needs to be counted separately. These browsers are then sorted in descending order of frequency, and the top N browsers are selected as the list of suspected incompatible browsers. The value of N can be set according to actual needs; it can be a preset value or the total number of browsers multiplied by a preset percentage. It should be noted that if the user interrupts recording during the process, it will also result in a failure to report again. Therefore, when determining the list of suspected incompatible browsers, a subset of browsers should be selected, rather than all browsers mentioned in the third parameter information, to avoid unnecessary testing and save subsequent testing and update time.
[0103] Step G: Send the list of suspected incompatible browsers to a preset test terminal so that the preset test terminal can detect whether there are incompatible browsers in the list of suspected incompatible browsers;
[0104] Step H: Receive the detection results returned by the preset test terminal, and update the preset list of incompatible browsers based on the detection results.
[0105] Finally, the list of suspected incompatible browsers is sent to a pre-set test server, which then checks if any of these browsers are indeed incompatible. The pre-set test server performs this check by manually selecting the appropriate browser type and version for the system on the terminal listed in the suspected incompatible browser list. After installation, it checks whether clicking the video recording button in the suspected incompatible browser causes a crash, thus determining if the browser is indeed incompatible. Alternatively, it checks whether clicking the video recording button initiates the recording process; if there is no response, the browser is considered incompatible. After completing the test, the pre-set test server returns the corresponding detection results to the web front-end server. Upon receiving the detection results from the pre-set test server, the web front-end server updates the pre-set list of incompatible browsers accordingly.
[0106] In this embodiment, by collecting data from user-end browsers, a list of suspected incompatible browsers is periodically obtained. This list is then used to update the preset list of incompatible browsers, solving the problem of continuously updating the incompatible browser list. Simultaneously, this method narrows the scope of browser compatibility testing in later updates, reducing the testing and update costs for incompatible browsers.
[0107] Furthermore, based on the first and second embodiments described above, a fourth embodiment of the browser compatibility detection method of the present invention is proposed.
[0108] In this embodiment, after step S30, the browser compatibility detection method further includes:
[0109] Step I: If it is determined that the current browser is an incompatible browser, a prompt message to switch browsers is generated and displayed in the current browser.
[0110] In this embodiment, if it is determined that the current browser is an incompatible browser, a prompt message to switch browsers is generated and displayed in the current browser to inform the user that the browser does not support the video recording function, and to promptly remind the user to update the browser, so as to avoid the user getting stuck in the video recording stage and unable to complete the entire operation process.
[0111] Furthermore, since the developer has the right to modify the browser's code, they can suggest the appropriate code modification method to resolve the browser incompatibility issue. Specifically, before the step of "generating a prompt to switch browsers and displaying the prompt in the current browser," the browser compatibility detection method can also include:
[0112] Step J: Determine whether the current browser is a self-developed browser based on the browser name;
[0113] In this embodiment, if it is determined that the current browser is an incompatible browser, it can first be determined whether the current browser is a self-developed browser based on the browser name. Specifically, it can be determined whether the current browser is a self-developed browser by detecting whether the browser name of the current browser is in the preset list of common browsers.
[0114] If the current browser is not a self-developed browser, then perform the following steps: generate a prompt message to switch browsers and display the prompt in the current browser;
[0115] Step K: If the current browser is a self-developed browser, then obtain the corresponding compatibility solution according to the system type.
[0116] Step L: Generate corresponding solution prompt information based on the compatibility solution and display the prompt in the current browser.
[0117] If the current browser is not a custom-developed browser, compatibility cannot be achieved by modifying the code. In this case, a prompt to switch browsers will be generated and displayed in the current browser to inform the user that the browser does not support video recording and to remind the user to update the browser in a timely manner.
[0118] If the current browser is a custom-developed browser, the corresponding compatibility solution is obtained based on the system type. Then, a corresponding solution prompt is generated based on the compatibility solution and displayed in the current browser. This allows the user to modify the custom-developed browser according to the solution prompt, enabling the browser to support video recording.
[0119] For example, if a developer has permission to modify the app code in their self-developed iOS browser app, they can prompt the user to add the following code to the info.plist file (used to provide some runtime configurations for the application) in the browser app's code project to request camera and microphone permissions, thus preventing crashes due to browser incompatibility:
[0120] .NS Microphone Usage Description
[0121] .NSCameraUsageDescription
[0122] After adding the above code to the iOS browser app, the web page in the browser can normally use the input tag to bring up the camera.
[0123] For example, if the developer has permission to modify the app code in their self-developed Android browser app, then compatibility development needs to be performed in the app as follows:
[0124] Add the following permissions to the Manifest.xml file (the information description file for the entire application):
[0125] <uses-permission android:name="android.permission.CAMERA" / >
[0126] <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" / >
[0127] <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" / >
[0128] <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" / >
[0129] <uses-permission android:name="android.permission.RECORD_AUDIO" / >
[0130] Then override the response method in webviewChromeClient. <input type="file"> The web page in the browser can then use the input tag to bring up the camera.
[0131] The present invention also provides a browser compatibility detection device.
[0132] Reference Figure 3 , Figure 3 This is a schematic diagram of the functional modules of the first embodiment of the browser compatibility detection device of the present invention.
[0133] like Figure 3 As shown, the browser compatibility detection device includes:
[0134] The first acquisition module 10 is used to acquire first target information through the preset interface of the current browser when the video recording function of the current browser is detected to be started.
[0135] The first parsing module 20 is used to parse the first target information to obtain the first parameter information;
[0136] The list matching module 30 is used to match the first parameter information with a preset list of incompatible browsers to obtain a matching result, and determine whether the current browser is an incompatible browser based on the matching result.
[0137] Furthermore, the first parsing module 20 includes:
[0138] The first matching unit is used to match the preset keywords with the first target information to obtain the system type and browser name corresponding to the current browser;
[0139] The determining unit is configured to determine the parameters to be matched based on the system type and the browser name, and to determine the keywords to be matched based on the browser name, the parameters to be matched, and a preset mapping relationship;
[0140] The second matching unit is used to match the keyword to be matched with the first target information to obtain the matching parameter information corresponding to the matching parameter, wherein the first parameter information includes system type, browser name and matching parameter information.
[0141] Furthermore, the determining unit is specifically used for:
[0142] Determine whether the current browser is the system browser or a third-party browser based on the browser name;
[0143] If the current browser is a third-party browser, then the parameter to be matched is determined to be the browser version number;
[0144] If the current browser is the system browser, then detect whether the system type is iOS or Android.
[0145] If the system type is iOS, then the parameter to be matched is determined to be the browser version number;
[0146] If the system type is Android, then the parameters to be matched are determined to be the browser kernel and version number, browser version number, system version number, and device brand.
[0147] Furthermore, the browser compatibility detection device also includes:
[0148] The receiving module is used to receive the second target information obtained from testing with incompatible browsers, sent by the testing end.
[0149] The second parsing module is used to parse the second target information to obtain the second parameter information;
[0150] The list generation module is used to generate the preset list of incompatible browsers based on the second parameter information.
[0151] Furthermore, the browser compatibility detection device also includes:
[0152] The monitoring module is used to monitor whether a second reporting information is received from the user's browser within a first preset time after receiving the initial reporting information from the user's browser.
[0153] The second acquisition module is used to acquire the third parameter information corresponding to the user browser if no secondary reporting information is received from the user browser within a first preset time, and store the third parameter information in a preset database.
[0154] The statistics module is used to periodically retrieve third parameter information from the preset database within a second preset time period, perform statistics, and determine a list of suspected incompatible browsers based on the statistical results.
[0155] The sending module is used to send the list of suspected incompatible browsers to a preset test terminal, so that the preset test terminal can detect whether there are incompatible browsers in the list of suspected incompatible browsers;
[0156] The update module is used to receive the detection results returned by the preset test terminal and update the preset list of incompatible browsers according to the detection results.
[0157] Furthermore, the browser compatibility detection device also includes:
[0158] The first prompt module is used to generate a prompt message to switch to another browser if it is determined that the current browser is an incompatible browser, and then display the prompt message in the current browser.
[0159] Furthermore, the browser compatibility detection device also includes:
[0160] The determination module is used to determine whether the current browser is a self-developed browser based on the browser name.
[0161] The first prompt module is specifically used to generate a prompt message to switch browsers if the current browser is not a self-developed browser, and to display the prompt in the current browser;
[0162] The third acquisition module is used to obtain the corresponding compatibility solution based on the system type if the current browser is a self-developed browser.
[0163] The second prompt module is used to generate corresponding solution prompt information based on the compatibility solution and display the prompt in the current browser.
[0164] The functions of each module in the browser compatibility detection device correspond to the steps in the browser compatibility detection method embodiment, and their functions and implementation processes will not be described in detail here.
[0165] The present invention also provides a readable storage medium storing a browser compatibility detection program, which, when executed by a processor, implements the steps of the browser compatibility detection method as described in any of the above embodiments.
[0166] The specific embodiments of the readable storage medium of the present invention are basically the same as the embodiments of the browser compatibility detection method described above, and will not be repeated here.
[0167] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0168] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0169] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0170] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A method for detecting browser compatibility, characterized in that, The browser compatibility detection method includes: When the current browser is detected to have started video recording, the first target information is obtained through the current browser's preset interface; the first target information is the user agent information of the current browser. Parsing the first target information to obtain first parameter information includes: matching preset keywords with the first target information to obtain the system type and browser name corresponding to the current browser; determining the parameter to be matched based on the system type and the browser name, and determining the keyword to be matched based on the browser name, the parameter to be matched, and a preset mapping relationship; matching the keyword to be matched with the first target information to obtain the parameter to be matched information corresponding to the parameter to be matched, wherein the first parameter information includes system type, browser name, and parameter to be matched information; the step of determining the parameter to be matched based on the system type and the browser name includes: determining whether the current browser is a system browser or a third-party browser based on the browser name; if the current browser is a third-party browser, determining the parameter to be matched as the browser version number; if the current browser is a system browser, detecting whether the system type is iOS or Android; if the system type is iOS, determining the parameter to be matched as the browser version number; if the system type is Android, determining the parameter to be matched as the browser kernel and version number, browser version number, system version number, and device brand; The first parameter information is matched with a preset list of incompatible browsers to obtain a matching result. Based on the matching result, it is determined whether the current browser is an incompatible browser. After receiving the initial report from the user's browser, the system monitors whether a secondary report is received from the user's browser within a first preset time period. If no secondary report is received from the user's browser within the first preset time period, the system obtains the third parameter information corresponding to the user's browser and stores the third parameter information in a preset database. The system periodically retrieves the third parameter information from the preset database for a second preset time period and performs statistical analysis. Based on the statistical results, a list of suspected incompatible browsers is determined, where the browsers in the suspected incompatible browser list are some of the browsers involved in the third parameter information within the second preset time period. The list of suspected incompatible browsers is sent to a preset test terminal so that the preset test terminal can detect whether there are incompatible browsers in the list. The system receives the detection results returned by the preset test terminal and updates the preset incompatible browser list based on the detection results.
2. The browser compatibility detection method as described in claim 1, characterized in that, The browser compatibility detection method also includes: Receive the second target information obtained from testing with incompatible browsers, sent by the test terminal; The second target information is parsed to obtain the second parameter information; The preset list of incompatible browsers is generated based on the second parameter information.
3. The browser compatibility detection method as described in claim 2, characterized in that, After the step of determining whether the current browser is an incompatible browser based on the matching result, the method further includes: If the current browser is determined to be incompatible, a prompt to switch to a different browser will be generated and displayed in the current browser.
4. The browser compatibility detection method as described in claim 3, characterized in that, Before the step of generating the browser switching prompt and displaying the prompt in the current browser, the method further includes: Determine whether the current browser is a self-developed browser based on the browser name; If the current browser is not a self-developed browser, then perform the following steps: generate a prompt message to switch browsers and display the prompt in the current browser; If the current browser is a self-developed browser, then obtain the corresponding compatibility solution based on the system type. Based on the aforementioned compatibility solution, a corresponding solution prompt message is generated and displayed in the current browser.
5. A browser compatibility detection device, characterized in that, The browser compatibility detection device includes: The first acquisition module is used to acquire first target information through a preset interface of the current browser when the video recording function of the current browser is detected to be started; the first target information is the user agent information of the current browser. The first parsing module is used to parse the first target information to obtain first parameter information. Specifically, the first parsing module is used to: match preset keywords with the first target information to obtain the system type and browser name corresponding to the current browser; determine the parameter to be matched based on the system type and browser name, and determine the keyword to be matched based on the browser name, the parameter to be matched, and a preset mapping relationship; match the keyword to be matched with the first target information to obtain the parameter to be matched information corresponding to the parameter to be matched, wherein the first parameter information includes system type, browser name, and parameter to be matched information; the step of determining the parameter to be matched based on the system type and browser name includes: determining whether the current browser is a system browser or a third-party browser based on the browser name; if the current browser is a third-party browser, determining the parameter to be matched as the browser version number; if the current browser is a system browser, detecting whether the system type is iOS or Android; if the system type is iOS, determining the parameter to be matched as the browser version number; if the system type is Android, determining the parameter to be matched as the browser kernel and version number, browser version number, system version number, and device brand. The list matching module is used to match the first parameter information with a preset list of incompatible browsers to obtain a matching result, and determine whether the current browser is an incompatible browser based on the matching result; The monitoring module is used to monitor whether a second reporting information is received from the user's browser within a first preset time after receiving the initial reporting information from the user's browser. The second acquisition module is used to acquire the third parameter information corresponding to the user browser if no secondary reporting information is received from the user browser within a first preset time, and store the third parameter information in a preset database. The statistics module is used to periodically obtain the third parameter information within a second preset time period from the preset database, perform statistics, and determine a list of suspected incompatible browsers based on the statistical results. The browsers in the list of suspected incompatible browsers are some of the browsers involved in the third parameter information within the second preset time period. The sending module is used to send the list of suspected incompatible browsers to a preset test terminal, so that the preset test terminal can detect whether there are incompatible browsers in the list of suspected incompatible browsers; The update module is used to receive the detection results returned by the preset test terminal and update the preset list of incompatible browsers according to the detection results.
6. A browser compatibility testing device, characterized in that, The browser compatibility detection device includes: a memory, a processor, and a browser compatibility detection program stored in the memory and executable on the processor. When the browser compatibility detection program is executed by the processor, it implements the steps of the browser compatibility detection method as described in any one of claims 1 to 4.
7. A readable storage medium, characterized in that, The readable storage medium stores a browser compatibility detection program, which, when executed by a processor, implements the steps of the browser compatibility detection method as described in any one of claims 1 to 4.