Data reporting method and device, computer equipment and storage medium
By loading the communication channel and event bus after the target application is started, listening to designated events and performing positioning authorization verification, the problem of inaccurate positioning results in the prior art is solved, and high-precision position information reporting is achieved.
Patent Information
- Application Number
- CN202411884391.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-03-28
AI Technical Summary
When the existing directly call the web page positioning API to obtain user location, the positioning results are not accurate enough, making it difficult to meet the needs of high-precision position information in the fields of finance and medical care.
After the target application is started, the preset communication channel is loaded and the event bus is started in the H5 page. Listen to the specified events (such as successful login or work order check-in event) to determine whether the location reporting is required. After positioning authorization verification, call the positioning component to obtain user location information, and use the timer to perform the location reporting operation.
It realizes the real-time location reporting of work orders automatically and accurately, ensures the accuracy of reported location information and meets the high-precision needs in the fields of finance, medical care, etc.
Smart Images

Figure CN119718724A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of data processing technology, financial technology, and digital medicine, and in particular to data reporting methods, devices, computer equipment, and storage media. Background Art
[0002] In today's digital age, with the rapid development of mobile Internet technology, the demand for mobile applications (APPs) in key areas such as finance and healthcare is growing. These applications often rely on users' location information to provide more accurate and personalized services. The importance of location information reporting function, as a bridge connecting users and service providers, is self-evident. It can not only help users quickly find nearby financial service outlets, hospitals or pharmacies, but also quickly locate users in emergency situations, such as when requesting medical assistance, to win precious time for rescue operations.
[0003] For APP developers and service providers, effective use of location information can not only improve user experience and enhance user stickiness, but also conduct in-depth analysis based on geographic location data, tap into potential market demand, optimize service layout, and maximize commercial value. Therefore, the improvement and optimization of location information reporting functions has become an important part of the APP development process.
[0004] However, with the rise of hybrid development models, more and more apps are choosing to combine native code with embedded HTML5 (H5) pages to achieve cross-platform compatibility and rapid iteration. While this development model brings flexibility and efficiency, it also brings new challenges to the acquisition of location information. In H5 pages, the traditional approach is to directly call the positioning API of the web page to obtain the user's location. Although this method is simple and easy to use and does not require additional development costs, its positioning accuracy is often limited by multiple factors such as browser permission settings, device hardware conditions, and network environment, resulting in inaccurate positioning results and difficulty in meeting the needs of finance, medical and other fields for high-precision location information. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a data reporting method, apparatus, computer device and storage medium to solve the technical problem that the existing positioning result of directly calling the positioning API of the web page to obtain the user location is not accurate enough.
[0006] In order to solve the above technical problems, the present application embodiment provides a data reporting method, which adopts the following technical solution:
[0007] After detecting that the target application is started, loading the preset communication channel, and starting the preset event bus in the H5 page corresponding to the target application;
[0008] If a designated event triggered by a user is monitored based on the event bus, it is determined whether there is a target work order that requires location reporting based on the designated event; wherein the designated event includes a successful login event or a work order sign-in event;
[0009] If so, performing a location authorization check on the target application based on the communication channel;
[0010] If the target application passes the location authorization check, calling a preset location component to obtain the user's location information;
[0011] Calling the timer corresponding to the H5 page;
[0012] A location reporting operation corresponding to the location information is performed based on the timer.
[0013] Furthermore, the step of determining whether there is a target work order requiring location reporting based on the specified event specifically includes:
[0014] Determine whether there is a query result corresponding to the specified event in a preset target cache;
[0015] If there is no query result corresponding to the specified event, extracting event parameters corresponding to the specified event;
[0016] Generate a corresponding specified query request based on the event parameters;
[0017] Sending the specified query request to a preset backend interface based on the communication channel;
[0018] Receiving response data corresponding to the specified query request returned by the backend interface;
[0019] The response data is parsed to identify whether there is a target work order that requires location reporting.
[0020] Furthermore, after the step of receiving the response data corresponding to the specified query request returned by the back-end interface, the method further includes:
[0021] Obtaining an event identifier corresponding to the specified event;
[0022] Generate a specified query result corresponding to the specified event based on the event identifier and the response data;
[0023] The specified query result is stored in the target cache.
[0024] Furthermore, the step of performing location authorization verification on the target application based on the communication channel specifically includes:
[0025] Based on the communication channel, calling a detection function corresponding to the target application;
[0026] Obtain the Boolean value result returned by the detection function;
[0027] Determine whether the Boolean value result is a target value;
[0028] If so, it is determined that the target application has passed the location authorization check; otherwise, it is determined that the target application has not passed the location authorization check.
[0029] Further, the step of performing a location reporting operation corresponding to the location information based on the timer specifically includes:
[0030] Get the preset reporting interval;
[0031] Based on the reporting interval, the timer is used to perform a location reporting operation corresponding to the location information.
[0032] Further, after the step of performing location authorization verification on the target application based on the communication channel, the method further includes:
[0033] If the target application fails the location authorization check, obtaining the work order information of the target work order;
[0034] Cache the work order information;
[0035] Get the preset location authorization prompt information;
[0036] The positioning authorization prompt information is displayed.
[0037] Further, after the step of performing a location reporting operation corresponding to the location information based on the timer, the method further includes:
[0038] If an end event corresponding to the target work order is monitored based on the event bus, a preset cancel function is called;
[0039] Performing cancellation processing on the timer based on the cancellation function;
[0040] End the location reporting operation corresponding to the location information.
[0041] In order to solve the above technical problems, the embodiment of the present application further provides a data reporting device, which adopts the following technical solution:
[0042] A first processing module is used to load a preset communication channel after detecting that a target application is started, and start a preset event bus in an H5 page corresponding to the target application;
[0043] A judgment module, for judging whether there is a target work order requiring location reporting based on a specified event triggered by a user monitored by the event bus; wherein the specified event includes a successful login event or a work order check-in event;
[0044] A verification module, configured to, if yes, perform a location authorization verification on the target application based on the communication channel;
[0045] A first acquisition module, configured to call a preset positioning component to acquire the user's location information if the target application passes the positioning authorization check;
[0046] A calling module, used to call a timer corresponding to the H5 page;
[0047] An execution module is used to execute a location reporting operation corresponding to the location information based on the timer.
[0048] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0049] After detecting that the target application is started, loading the preset communication channel, and starting the preset event bus in the H5 page corresponding to the target application;
[0050] If a designated event triggered by a user is monitored based on the event bus, it is determined whether there is a target work order that requires location reporting based on the designated event; wherein the designated event includes a successful login event or a work order sign-in event;
[0051] If so, performing a location authorization check on the target application based on the communication channel;
[0052] If the target application passes the location authorization check, calling a preset location component to obtain the user's location information;
[0053] Calling the timer corresponding to the H5 page;
[0054] A location reporting operation corresponding to the location information is performed based on the timer.
[0055] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0056] After detecting that the target application is started, loading the preset communication channel, and starting the preset event bus in the H5 page corresponding to the target application;
[0057] If a designated event triggered by a user is monitored based on the event bus, it is determined whether there is a target work order that requires location reporting based on the designated event; wherein the designated event includes a successful login event or a work order sign-in event;
[0058] If so, performing a location authorization check on the target application based on the communication channel;
[0059] If the target application passes the location authorization check, calling a preset location component to obtain the user's location information;
[0060] Calling the timer corresponding to the H5 page;
[0061] A location reporting operation corresponding to the location information is performed based on the timer.
[0062] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0063] The present application first loads a preset communication channel after detecting that the target application is started, and starts a preset event bus in the H5 page corresponding to the target application; if a specified event triggered by a user is monitored based on the event bus, it is determined whether there is a target work order that needs to report the location based on the specified event; wherein the specified event includes a successful login event or a work order check-in event; if so, a positioning authorization check is performed on the target application based on the communication channel; if the target application passes the positioning authorization check, a preset positioning component is called to obtain the user's location information; subsequently, a timer corresponding to the H5 page is called; finally, a location reporting operation corresponding to the location information is performed based on the timer. After detecting that the target application is started, the present application loads the preset communication channel and starts the preset event bus in the H5 page corresponding to the target application. If the event bus monitors the specified event triggered by the user, it determines whether there is a target work order that needs to report the location based on the specified event. If so, the target application is located and authorized to check the location based on the communication channel. If the target application passes the location authorization check, the preset positioning component is called to obtain the location information of the user, and the timer corresponding to the H5 page is subsequently called. Based on the timer, the location reporting operation corresponding to the location information is executed, thereby automatically and accurately realizing the real-time location reporting processing of the work order and ensuring the accuracy of the reported location information. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0065] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0066] Figure 2 A flowchart according to an embodiment of a data reporting method of the present application;
[0067] Figure 3 is a structural diagram of an embodiment of a data reporting device according to the present application;
[0068] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0069] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0070] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0071] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0072] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0073] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0074] The terminal device 101 can be any electronic device with a display screen and supporting web browsing. In addition to the laptop computer 1011, tablet computer 1012 or mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, etc.
[0075] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .
[0076] It should be noted that the data reporting method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the data reporting device is generally set in the server / terminal device.
[0077] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0078] Continue to refer Figure 2 , showing a flow chart of an embodiment of the data reporting method according to the present application. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted. The data reporting method provided in the embodiment of the present application can be applied to any scenario that requires location reporting, and the data reporting method can be applied to products in these scenarios, for example, location reporting of applications used in the financial insurance field or the digital medical field. The data reporting method comprises the following steps:
[0079] Step S201, after detecting that the target application is started, loading a preset communication channel, and starting a preset event bus in an H5 page corresponding to the target application.
[0080] In this embodiment, the electronic device (eg Figure 1The server / terminal device shown in the figure) can obtain relevant data in the target application through a wired connection or a wireless connection. It should be pointed out that the above-mentioned wireless connection method may include but is not limited to 3G / 4G / 5G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future. The execution subject of this application may specifically be a terminal device installed with a target application. When the user opens the above-mentioned target application, the target application starts to load and start. The above-mentioned communication channel is specifically a JSBridge module, which is pre-developed for communication between the native APP (ie, the target application) and the H5 page. It allows the H5 page to call the functions of the native APP and also allows the native APP to receive messages from the H5 page. The above-mentioned event bus refers to eventBus. EventBus is an event bus for event monitoring and message delivery across components and pages within the H5 page. By configuring eventBus in the H5 page, it can monitor global events and execute corresponding callback functions when events are triggered. Among them, in the business scenarios in the field of financial technology, the above-mentioned target applications may include claims applications, insurance applications, etc., and in the business scenarios in the field of digital medicine, the above-mentioned target applications may include medical applications.
[0081] Step S202: If a designated event triggered by a user is monitored based on the event bus, it is determined whether there is a target work order requiring location reporting based on the designated event; wherein the designated event includes a successful login event or a work order check-in event.
[0082] In this embodiment, the specific implementation process of judging whether there is a target work order requiring location reporting based on the specified event will be described in further detail in subsequent specific embodiments of the present application and will not be elaborated on here.
[0083] Step S203: If yes, perform location authorization verification on the target application based on the communication channel.
[0084] In this embodiment, the specific implementation process of performing the positioning authorization verification on the target application based on the communication channel will be described in further detail in subsequent specific embodiments of the present application, and will not be elaborated on here.
[0085] Step S204: If the target application passes the location authorization check, a preset location component is called to obtain the user's location information.
[0086] In this embodiment, the positioning component is a positioning API provided by the target application, or a third-party positioning library may be used. The positioning component returns a result (success or failure) after being called, and provides location information (such as latitude and longitude) when successful.
[0087] Step S205, calling the timer corresponding to the H5 page.
[0088] In this embodiment, the timer is a timer pre-set using the timer function (such as setInterval) of the H5 page.
[0089] Step S206: Execute a location reporting operation corresponding to the location information based on the timer.
[0090] In this embodiment, the specific implementation process of the above-mentioned location reporting operation corresponding to the location information based on the timer will be further described in detail in subsequent specific embodiments of the present application, and will not be elaborated on here.
[0091] The present application first loads a preset communication channel after detecting that the target application is started, and starts a preset event bus in the H5 page corresponding to the target application; if a specified event triggered by a user is monitored based on the event bus, it is determined whether there is a target work order that needs to report the location based on the specified event; wherein the specified event includes a successful login event or a work order check-in event; if so, a positioning authorization check is performed on the target application based on the communication channel; if the target application passes the positioning authorization check, a preset positioning component is called to obtain the user's location information; subsequently, a timer corresponding to the H5 page is called; finally, a location reporting operation corresponding to the location information is performed based on the timer. After detecting that the target application is started, the present application loads the preset communication channel and starts the preset event bus in the H5 page corresponding to the target application. If the event bus monitors the specified event triggered by the user, it determines whether there is a target work order that needs to report the location based on the specified event. If so, the target application is located and authorized to check the location based on the communication channel. If the target application passes the location authorization check, the preset positioning component is called to obtain the location information of the user, and the timer corresponding to the H5 page is subsequently called. Based on the timer, the location reporting operation corresponding to the location information is executed, thereby automatically and accurately realizing the real-time location reporting processing of the work order and ensuring the accuracy of the reported location information.
[0092] In some optional implementations, step S202 includes the following steps:
[0093] It is determined whether there is a query result corresponding to the specified event in a preset target cache.
[0094] In this embodiment, the target cache is a pre-built cache for storing query results related to events for a period of time. During this period, if the user triggers a successful login event or a work order check-in event again, the query result corresponding to the event in the target cache can be directly used, so there is no need to initiate a query request to the backend interface again, thereby improving the efficiency of obtaining query results.
[0095] If there is no query result corresponding to the specified event, then the event parameter corresponding to the specified event is extracted.
[0096] In this embodiment, the event parameters of the above-mentioned specified event may include at least a user ID, a work order status, and may also include a current timestamp.
[0097] A corresponding specified query request is generated based on the event parameters.
[0098] In this embodiment, the above-mentioned specified query request is a request carrying the above-mentioned event parameters.
[0099] The designated query request is sent to a preset backend interface based on the communication channel.
[0100] In this embodiment, the network request function (such as fetch or XMLHttpRequest) of the H5 page can be used to initiate the above-mentioned specified query request to the backend interface through JSBridge, i.e., the communication channel, to pass the prepared event parameters. The above-mentioned backend interface is an interface provided on the backend for querying whether the user currently has a work order that requires real-time reporting of location information.
[0101] Receive response data corresponding to the specified query request returned by the backend interface.
[0102] In this embodiment, the backend interface returns corresponding response data after receiving the event parameters.
[0103] The response data is parsed to identify whether there is a target work order that requires location reporting.
[0104] In this embodiment, by performing content analysis on the response data, it is determined whether the user has a work order requiring real-time reporting of location information based on the obtained content analysis result.
[0105] The present application determines whether there is a query result corresponding to the specified event in the preset target cache; if there is no query result corresponding to the specified event, the event parameters corresponding to the specified event are extracted; then a corresponding specified query request is generated based on the event parameters; then the specified query request is sent to the preset backend interface based on the communication channel; the response data corresponding to the specified query request returned by the backend interface is subsequently received; and finally the response data is parsed to identify whether there is a target work order that needs to report the location. If the present application detects that there is no query result corresponding to the specified event in the preset target cache, the event parameters corresponding to the specified event will be extracted, and a corresponding specified query request will be generated based on the event parameters, and then the specified query request will be sent to the preset backend interface based on the use of the communication channel. Subsequently, by parsing the response data corresponding to the specified query request returned by the backend interface, it is possible to quickly and accurately identify whether the user has a work order that needs to report the location information in real time based on the obtained content parsing result, effectively improving the accuracy of the obtained recognition result.
[0106] In some optional implementations of this embodiment, after the step of receiving the response data corresponding to the specified query request returned by the backend interface, the method further includes:
[0107] Get the event identifier corresponding to the specified event.
[0108] In this embodiment, the event identifier includes the event name of the specified event.
[0109] A specified query result corresponding to the specified event is generated based on the event identifier and the response data.
[0110] In this embodiment, the specified query result may include data with the event identifier as a key and the response data as a key value.
[0111] The specified query result is stored in the target cache.
[0112] In this embodiment, the target cache may specifically adopt redis cache or memory.
[0113] This application obtains the event identifier corresponding to the specified event; then generates the specified query result corresponding to the specified event based on the event identifier and the response data; and subsequently stores the specified query result in the target cache. After receiving the response data corresponding to the specified query request returned by the back-end interface, this application will intelligently obtain the event identifier corresponding to the specified event, and generate the specified query result corresponding to the specified event based on the event identifier and the response data, and then store the specified query result in the target cache, so that when the subsequent user triggers the target event again, the query result stored in the target cache can be directly used, so that there is no need to initiate a query request to the back-end interface again, thereby effectively improving the efficiency of obtaining the query results corresponding to the target event, and thereby improving the processing efficiency of identifying whether there is a target work order that needs to report the location.
[0114] In some optional implementations, step S203 includes the following steps:
[0115] Based on the communication channel, a detection function corresponding to the target application is called.
[0116] In this embodiment, the communication channel is JSBridge. JSBridge is a JS-implemented two-way communication channel for bridging native APP and H5. It allows Native to call JS and JS to call Native conveniently in APP. JSBridge mainly provides the ability for JS to call Native code. By using JSBridge to call the native APP in the H5 page, the API provided by the target application is used to check the positioning authorization status. Among them, an API for checking the positioning authorization status is provided in the target application. This API is a function, namely the above-mentioned detection function. When the detection function is called, it returns a Boolean value to indicate the authorization status.
[0117] Get the Boolean result returned by the detection function.
[0118] In this embodiment, the content of the above Boolean value result includes true or false, true means that the positioning authorization has been obtained and the location information can be continuously attempted to be obtained, and false means that the positioning authorization has not been obtained.
[0119] Determine whether the Boolean value result is a target value.
[0120] In this embodiment, the target value is true.
[0121] If so, it is determined that the target application has passed the location authorization check; otherwise, it is determined that the target application has not passed the location authorization check.
[0122] In this embodiment, if the Boolean value result returned by the detection function is true, it is determined that the target application has passed the location authorization check; and if the Boolean value result returned by the detection function is false, it is determined that the target application has not passed the location authorization check.
[0123] This application calls the detection function corresponding to the target application based on the communication channel; then obtains the Boolean value result returned by the detection function; subsequently determines whether the Boolean value result is the target value; if so, determines that the target application has passed the positioning authorization check, otherwise determines that the target application has not passed the positioning authorization check. This application calls the detection function corresponding to the target application based on the use of the communication channel, obtains the Boolean value result returned by the detection function, and then compares the Boolean value result with the target value, so that the positioning authorization check processing for the target application can be completed efficiently and accurately, ensuring the accuracy of the positioning authorization check result.
[0124] In some optional implementations, step S206 includes the following steps:
[0125] Get the preset reporting interval.
[0126] In this embodiment, there is no specific limitation on the selection of the above-mentioned reporting interval time, which can be set according to actual business needs, for example, it can be set to 5s or 10s.
[0127] Based on the reporting interval, the timer is used to perform a location reporting operation corresponding to the location information.
[0128] In this embodiment, a timer can be pre-set by using the timer function (such as setInterval) of the H5 page. Then, by using the timer, the operation of reporting the location information is performed once every certain time (such as 5 seconds or 10 seconds) according to the above reporting interval.
[0129] The present application obtains a preset reporting interval time; subsequently based on the reporting interval time, the timer is used to perform a location reporting operation corresponding to the location information. The present application obtains a preset reporting interval time, and then based on the reporting interval time, the timer is used to perform a location reporting operation corresponding to the location information, thereby realizing the timed reporting processing of the location information, and improving the intelligence and standardization of the location reporting processing.
[0130] In some optional implementations of this embodiment, after step S203, the electronic device may further perform the following steps:
[0131] If the target application fails the location authorization check, the work order information of the target work order is obtained.
[0132] In this embodiment, the work order information of the target work order can be obtained by acquiring information of the target work order.
[0133] The work order information is cached.
[0134] In this embodiment, by caching the work order information, after completing the location authorization for the target application, the cached work order information can be automatically obtained and the continuous location reporting process can be automatically started. The work order information can be cached using mechanisms such as the browser's localStorage or sessionStorage.
[0135] Get the preset location authorization prompt information.
[0136] In this embodiment, the above-mentioned location authorization prompt information is pre-constructed prompt information that informs the user that the location permission needs to be granted, and the location authorization prompt information includes a setting page.
[0137] The positioning authorization prompt information is displayed.
[0138] In this embodiment, the location authorization prompt information is displayed to guide the user to the setting page of the target application and manually enable the location permission. The jump to the setting page can be achieved by providing a button or link, which will trigger the native APP, that is, a function of the target application, and directly jump to the setting page.
[0139] If the present application detects that the target application has not passed the location authorization check, the work order information of the target work order is obtained; the work order information is then cached; the preset location authorization prompt information is obtained; and the location authorization prompt information is subsequently displayed. When the present application detects that the target application has not passed the location authorization check, it will intelligently obtain the work order information of the target work order and cache it, which is beneficial for automatically obtaining the cached work order information and automatically continuing to start the continuous location reporting process after completing the location authorization for the target application. In addition, the preset location authorization prompt information will also be displayed to automatically and intelligently guide the user to the settings page of the target application and manually enable location permissions, thereby improving the intelligence of the location authorization processing for the target application and improving the user experience.
[0140] In some optional implementations of this embodiment, after step S206, the electronic device may further perform the following steps:
[0141] If an end event corresponding to the target work order is monitored based on the event bus, a preset cancel function is called.
[0142] In this embodiment, the above-mentioned end event may refer to an event triggered by a user manually ending a work order in some way (such as clicking a button), and this event can be monitored through eventBus. Among them, the above-mentioned cancel function can specifically adopt the clearInterval function. EventBus is used to enable event monitoring inside the H5 page, and global monitoring events can be performed on multiple different pages and unified callbacks can be implemented. In addition, it is also possible to determine whether it is necessary to continue position reporting or end position reporting based on the field information returned by the reporting interface.
[0143] The timer is cancelled based on the cancellation function.
[0144] In this embodiment, the previously set timer can be canceled by using the clearInterval function.
[0145] End the location reporting operation corresponding to the location information.
[0146] In this embodiment, the location reporting operation corresponding to the location information is terminated by calling the positioning component to stop acquiring the user's location information.
[0147] If the present application monitors the end event corresponding to the target work order based on the event bus, the preset cancellation function is called; then the timer is canceled based on the cancellation function; and the location reporting operation corresponding to the location information is subsequently terminated. After the present application monitors the end event corresponding to the target work order based on the use of the event bus, the timer is intelligently canceled based on the use of the cancellation function, and the location reporting operation corresponding to the location information is automatically terminated, thereby completing the end reporting process of the location reporting corresponding to the target work order, and improving the processing intelligence of the end process of the location reporting.
[0148] In some optional implementations, the user information obtained is subject to the user's consent and complies with relevant laws and policies.
[0149] In addition, the non-Company software tools or components that appear in the embodiments of the present application are merely examples and do not represent actual use.
[0150] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0151] It should be emphasized that in order to further ensure the privacy and security of the above location information, the above location information can also be stored in a blockchain node.
[0152] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0153] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0154] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0155] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0156] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0157] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a data reporting device, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0158] like Figure 3 As shown, the data reporting device 300 described in this embodiment includes: a first processing module 301, a judgment module 302, a verification module 303, a first acquisition module 304, a calling module 305 and an execution module 306. Among them:
[0159] The first processing module 301 is used to load a preset communication channel and start a preset event bus in an H5 page corresponding to the target application after detecting that the target application is started;
[0160] The judgment module 302 is used to judge whether there is a target work order that needs to report the location based on the specified event if a specified event triggered by the user is monitored based on the event bus; wherein the specified event includes a successful login event or a work order check-in event;
[0161] A verification module 303, configured to perform a location authorization verification on the target application based on the communication channel;
[0162] A first acquisition module 304 is configured to call a preset positioning component to acquire the user's location information if the target application passes the positioning authorization check;
[0163] A calling module 305 is used to call a timer corresponding to the H5 page;
[0164] The execution module 306 is used to execute a location reporting operation corresponding to the location information based on the timer.
[0165] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the data reporting method in the above-mentioned implementation mode, and are not described in detail here.
[0166] In some optional implementations of this embodiment, the determination module 302 includes:
[0167] A first judgment submodule is used to judge whether there is a query result corresponding to the specified event in a preset target cache;
[0168] An extraction submodule, configured to extract event parameters corresponding to the specified event if no query result corresponding to the specified event exists;
[0169] A first generating submodule, configured to generate a corresponding specified query request based on the event parameters;
[0170] A sending submodule, used for sending the specified query request to a preset backend interface based on the communication channel;
[0171] A receiving submodule, configured to receive response data corresponding to the specified query request returned by the backend interface;
[0172] The identification submodule is used to parse the response data to identify whether there is a target work order that requires location reporting.
[0173] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the data reporting method in the above-mentioned implementation mode, and are not described in detail here.
[0174] In some optional implementations of this embodiment, the judgment module 302 further includes:
[0175] A first acquisition submodule, used to acquire an event identifier corresponding to the specified event;
[0176] A second generating submodule, configured to generate a specified query result corresponding to the specified event based on the event identifier and the response data;
[0177] The storage submodule is used to store the specified query result in the target cache.
[0178] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the data reporting method in the above-mentioned implementation mode, and are not described in detail here.
[0179] In some optional implementations of this embodiment, the verification module 303 includes:
[0180] A calling submodule, used for calling a detection function corresponding to the target application based on the communication channel;
[0181] A second acquisition submodule is used to obtain a Boolean value result returned by the detection function;
[0182] A second judgment submodule is used to judge whether the Boolean value result is a target value;
[0183] The determination submodule is used to determine that if yes, the target application has passed the location authorization verification; otherwise, determine that the target application has not passed the location authorization verification.
[0184] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the data reporting method in the above-mentioned implementation mode, and are not described in detail here.
[0185] In some optional implementations of this embodiment, the execution module 306 includes:
[0186] The third acquisition submodule is used to obtain a preset reporting interval;
[0187] An execution submodule is used to use the timer to perform a location reporting operation corresponding to the location information based on the reporting interval.
[0188] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the data reporting method in the above-mentioned implementation mode, and are not described in detail here.
[0189] In some optional implementations of this embodiment, the data reporting device further includes:
[0190] A second acquisition module, configured to acquire the work order information of the target work order if the target application fails the location authorization verification;
[0191] A cache module, used for caching the work order information;
[0192] The third acquisition module is used to obtain preset positioning authorization prompt information;
[0193] The display module is used to display the positioning authorization prompt information.
[0194] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the data reporting method in the above-mentioned implementation mode, and are not described in detail here.
[0195] In some optional implementations of this embodiment, the data reporting device further includes:
[0196] A calling module, configured to call a preset cancel function if an end event corresponding to the target work order is monitored based on the event bus;
[0197] A second processing module, configured to cancel the timer based on the cancel function;
[0198] The third processing module is used to end the location reporting operation corresponding to the location information.
[0199] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the data reporting method in the above-mentioned implementation mode, and are not described in detail here.
[0200] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0201] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0202] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0203] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the computer device 4. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the data reporting method, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.
[0204] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run computer-readable instructions stored in the memory 41 or process data, such as computer-readable instructions for running the data reporting method.
[0205] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0206] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0207] In an embodiment of the present application, the present application first loads a preset communication channel after detecting that the target application is started, and starts a preset event bus in the H5 page corresponding to the target application; if a specified event triggered by a user is monitored based on the event bus, it is determined whether there is a target work order that needs to report the location based on the specified event; wherein the specified event includes a successful login event or a work order check-in event; if so, a positioning authorization check is performed on the target application based on the communication channel; if the target application passes the positioning authorization check, a preset positioning component is called to obtain the user's location information; subsequently, a timer corresponding to the H5 page is called; finally, a location reporting operation corresponding to the location information is performed based on the timer. After detecting that the target application is started, the present application loads the preset communication channel and starts the preset event bus in the H5 page corresponding to the target application. If the event bus monitors the specified event triggered by the user, it determines whether there is a target work order that needs to report the location based on the specified event. If so, the target application is located and authorized to check the location based on the communication channel. If the target application passes the location authorization check, the preset positioning component is called to obtain the location information of the user, and the timer corresponding to the H5 page is subsequently called. Based on the timer, the location reporting operation corresponding to the location information is executed, thereby automatically and accurately realizing the real-time location reporting processing of the work order and ensuring the accuracy of the reported location information.
[0208] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the data reporting method as described above.
[0209] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0210] In an embodiment of the present application, the present application first loads a preset communication channel after detecting that the target application is started, and starts a preset event bus in the H5 page corresponding to the target application; if a specified event triggered by a user is monitored based on the event bus, it is determined whether there is a target work order that needs to report the location based on the specified event; wherein the specified event includes a successful login event or a work order check-in event; if so, a positioning authorization check is performed on the target application based on the communication channel; if the target application passes the positioning authorization check, a preset positioning component is called to obtain the user's location information; subsequently, a timer corresponding to the H5 page is called; finally, a location reporting operation corresponding to the location information is performed based on the timer. After detecting that the target application is started, the present application loads the preset communication channel and starts the preset event bus in the H5 page corresponding to the target application. If the event bus monitors the specified event triggered by the user, it determines whether there is a target work order that needs to report the location based on the specified event. If so, the target application is located and authorized to check the location based on the communication channel. If the target application passes the location authorization check, the preset positioning component is called to obtain the location information of the user, and the timer corresponding to the H5 page is subsequently called. Based on the timer, the location reporting operation corresponding to the location information is executed, thereby automatically and accurately realizing the real-time location reporting processing of the work order and ensuring the accuracy of the reported location information.
[0211] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0212] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. A data reporting method, characterized in that: The steps include: After detecting that the target application is started, loading the preset communication channel, and starting the preset event bus in the H5 page corresponding to the target application; If a designated event triggered by a user is monitored based on the event bus, it is determined whether there is a target work order that requires location reporting based on the designated event; wherein the designated event includes a successful login event or a work order sign-in event; If so, performing a location authorization check on the target application based on the communication channel; If the target application passes the location authorization check, calling a preset location component to obtain the user's location information; Calling the timer corresponding to the H5 page; A location reporting operation corresponding to the location information is performed based on the timer.
2. The data reporting method according to claim 1, characterized in that: The step of judging whether there is a target work order requiring location reporting based on the specified event specifically includes: Determine whether there is a query result corresponding to the specified event in a preset target cache; If there is no query result corresponding to the specified event, extracting event parameters corresponding to the specified event; Generate a corresponding specified query request based on the event parameters; Sending the specified query request to a preset backend interface based on the communication channel; Receiving response data corresponding to the specified query request returned by the backend interface; The response data is parsed to identify whether there is a target work order that requires location reporting.
3. The data reporting method according to claim 2, characterized in that: After the step of receiving the response data corresponding to the specified query request returned by the back-end interface, the method further includes: Obtaining an event identifier corresponding to the specified event; Generate a specified query result corresponding to the specified event based on the event identifier and the response data; The specified query result is stored in the target cache.
4. The data reporting method according to claim 1, characterized in that: The step of performing location authorization verification on the target application based on the communication channel specifically includes: Based on the communication channel, calling a detection function corresponding to the target application; Obtain the Boolean value result returned by the detection function; Determine whether the Boolean value result is a target value; If so, it is determined that the target application has passed the location authorization check; otherwise, it is determined that the target application has not passed the location authorization check.
5. The data reporting method according to claim 1, characterized in that: The step of performing a location reporting operation corresponding to the location information based on the timer specifically includes: Get the preset reporting interval; Based on the reporting interval, the timer is used to perform a location reporting operation corresponding to the location information.
6. The data reporting method according to claim 1, characterized in that: After the step of performing location authorization verification on the target application based on the communication channel, the method further includes: If the target application fails the location authorization check, obtaining the work order information of the target work order; Cache the work order information; Get the preset location authorization prompt information; The positioning authorization prompt information is displayed.
7. The data reporting method according to claim 1, characterized in that: After the step of performing a location reporting operation corresponding to the location information based on the timer, the method further includes: If an end event corresponding to the target work order is monitored based on the event bus, a preset cancel function is called; Performing cancellation processing on the timer based on the cancellation function; End the location reporting operation corresponding to the location information.
8. A data reporting device, characterized in that: include: A first processing module is used to load a preset communication channel after detecting that a target application is started, and start a preset event bus in an H5 page corresponding to the target application; A judgment module, for judging whether there is a target work order requiring location reporting based on a specified event triggered by a user monitored by the event bus; wherein the specified event includes a successful login event or a work order check-in event; A verification module, configured to, if yes, perform a location authorization verification on the target application based on the communication channel; A first acquisition module, configured to call a preset positioning component to acquire the user's location information if the target application passes the positioning authorization check; A calling module, used to call a timer corresponding to the H5 page; An execution module is used to execute a location reporting operation corresponding to the location information based on the timer.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the data reporting method according to any one of claims 1 to 7 when executing the computer-readable instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the data reporting method according to any one of claims 1 to 7 are implemented.