A method, device, electronic device and storage medium for determining a device code
By receiving the reported data and historical device codes from the client and generating the device code mapping table, the problem of the device code generation method affecting stability in the prior art is solved, and higher device code stability and uniformity are achieved.
Patent Information
- Application Number
- CN202210735105.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-27
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2042-06-27
AI Technical Summary
The existing device code generation method occupies more APP resources when the client generates, affecting stability; when the server generates, some devices may not be able to obtain device code due to network transmission and other reasons, which also affects stability.
By receiving the reported data from the client, including the currently acquired device code and historical device code, the normalization result is determined, and a device code mapping table is generated to instruct the client to obtain the target device code.
It improves the stability of the device code, reduces the use of APP resources, overcomes the problem of failure to obtain device code caused by network transmission, and improves the unity of the device code, making it easier for users to maintain and use.
Smart Images

Figure CN115048428B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of Internet technology, and in particular to a method and apparatus for determining a device code, an electronic device, and a storage medium. Background Art
[0002] The device code is the device identification (ID) at the application (APP) level. The device code can be used to safely and effectively identify the device accessing the application, so it is usually necessary to generate a device code for the device. The generated device code can be used in various business scenarios (such as advertising, video recommendation, indicator analysis, etc.).
[0003] At present, common device code generation methods usually include client generation method and server generation method. In the client generation method, the client generates the device code based on its own resources. In the server generation method, the client requests the server to generate the device code through the network. After the server generates the device code, it sends the device code to the client based on the network.
[0004] However, the client-side generation method significantly occupies APP resources and affects the stability of the device code. In the server-side generation method, due to network transmission and other reasons, some devices may not be able to obtain the device code, which will also affect the stability of the device code. Summary of the invention
[0005] The embodiments of the present disclosure provide a method, an apparatus, an electronic device, and a storage medium for determining a device code, thereby improving the stability of the device code.
[0006] According to one aspect of an embodiment of the present disclosure, a method for determining a device code is provided, including:
[0007] Receiving reported data from a client, where the reported data includes a first device code, where the first device code is a device code currently acquired by the client;
[0008] Determine a normalization result according to the first device code and the stored historical device code of the client;
[0009] A device code mapping table is generated according to the first device code, the historical device code and the normalization result. The device code mapping table is used to instruct the client to obtain a target device code, which is a normalization result obtained by mapping the device code to be used by the client to the device code mapping table.
[0010] In an exemplary implementation, when the code is successfully sent to the client, the first device code is a device code obtained by the client from a server; when the code is failed to be sent to the client, the first device code is a device code generated by the client.
[0011] In an exemplary implementation, the reported data further includes a second device code, where the second device code is a device code that the client has acquired before;
[0012] The determining the normalization result according to the first device code and the stored historical device code of the client, and generating a device code mapping table according to the first device code, the historical device code and the normalization result, includes:
[0013] Determining the normalization result according to the first device code, the second device code, and the stored historical device code of the client;
[0014] The device code mapping table is generated according to the first device code, the second device code, the historical device code, and the normalization result.
[0015] In an exemplary implementation, generating the device code mapping table according to the first device code, the second device code, the historical device code, and the normalization result includes:
[0016] determining a first edge, the first edge including the second device code as a starting point and the first device code as an end point;
[0017] If the acquisition time of the historical device code is earlier than that of the second device code, the historical device code is connected to the starting point to form a second edge, and if the acquisition time of the historical device code is later than that of the first device code, the end point is connected to the historical device code to form a second edge;
[0018] The device code mapping table is generated, wherein the device code mapping table stores data pairs including keys and values, wherein the values are the normalized results, and the keys include the start point and the end point of the first edge and the start point and the end point of the second edge.
[0019] In an exemplary implementation, determining a normalization result according to the first device code and the stored historical device code of the client includes:
[0020] sorting the first device code and the historical device code based on device code attribute information;
[0021] Based on a preset condition, the normalized result is selected from the sorted first device codes and the historical device codes.
[0022] In an exemplary implementation, the device code attribute information includes at least one of the following:
[0023] Device code timestamp; device code usage frequency; device code complexity.
[0024] In an exemplary embodiment, the method further includes:
[0025] receiving, from the client, a device code acquisition request including the device code to be used;
[0026] In response to the device code acquisition request, mapping the device code mapping table using the device code to be used to obtain the target device code;
[0027] A reply message including the target device code is sent to the client.
[0028] In an exemplary embodiment, the method further includes:
[0029] The device code mapping table is sent to the client, wherein the client maps the device code mapping table with the device code to be used to obtain the target device code.
[0030] According to another aspect of an embodiment of the present disclosure, there is provided an apparatus for determining a device code, including:
[0031] A receiving module is configured to receive reported data from a client, wherein the reported data includes a first device code, and the first device code is a device code currently acquired by the client;
[0032] a determination module, configured to determine a normalization result according to the first device code and the stored historical device code of the client;
[0033] A generation module is configured to generate a device code mapping table based on the first device code, the historical device code and the normalization result, wherein the device code mapping table is used to instruct the client to obtain a target device code, which is a normalized result obtained by mapping the device code to be used by the client to the device code mapping table.
[0034] In an exemplary implementation, when the code is successfully sent to the client, the first device code is a device code obtained by the client from a server; when the code is failed to be sent to the client, the first device code is a device code generated by the client.
[0035] In an exemplary implementation, the reported data further includes a second device code, where the second device code is a device code that the client has acquired before;
[0036] The generation module is configured as follows:
[0037] Determining the normalization result according to the first device code, the second device code, and the stored historical device code of the client;
[0038] The device code mapping table is generated according to the first device code, the second device code, the historical device code, and the normalization result.
[0039] In an exemplary implementation, the generating module is configured to:
[0040] determining a first edge, the first edge including the second device code as a starting point and the first device code as an end point;
[0041] If the acquisition time of the historical device code is earlier than that of the second device code, the historical device code is connected to the starting point to form a second edge, and if the acquisition time of the historical device code is later than that of the first device code, the end point is connected to the historical device code to form a second edge;
[0042] The device code mapping table is generated, wherein the device code mapping table stores data pairs including keys and values, wherein the values are the normalized results, and the keys include the start point and the end point of the first edge and the start point and the end point of the second edge.
[0043] In an exemplary implementation, the determining module is configured to:
[0044] sorting the first device code and the historical device code based on device code attribute information;
[0045] Based on a preset condition, the normalized result is selected from the sorted first device codes and the historical device codes.
[0046] In an exemplary implementation, the device code attribute information includes at least one of the following:
[0047] Device code timestamp; device code usage frequency; device code complexity.
[0048] In an exemplary implementation, the receiving module is configured to receive a device code acquisition request including the device code to be used from the client; the apparatus further includes:
[0049] The sending module is configured to: in response to the device code acquisition request, map the device code mapping table using the device code to be used to obtain the target device code; and send a reply message containing the target device code to the client.
[0050] In an exemplary embodiment, the apparatus further comprises:
[0051] The sending module is configured to send the device code mapping table to the client, wherein the client maps the device code mapping table with the device code to be used to obtain the target device code.
[0052] According to another aspect of the present disclosure, an electronic device is provided. The electronic device includes:
[0053] processor;
[0054] a memory for storing instructions executable by the processor;
[0055] The processor is used to read the executable instructions from the memory and execute the executable instructions to implement the above-mentioned method for determining the device code.
[0056] According to another aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer instructions are stored. When the computer instructions are executed by a processor, the above-mentioned method for determining the device code is implemented.
[0057] According to another aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method for determining the device code is implemented.
[0058] The technical solution provided by the embodiments of the present disclosure may at least include the following beneficial effects: the present disclosure combines the client device code generation method and the server device code generation method, and compared with the client device code generation method, it reduces the occupation of APP resources; compared with the server device code generation method, it overcomes the defect of being unable to obtain the device code and improves the stability of the device code. Moreover, the present disclosure constructs a device code mapping table for instructing the client to obtain the target device code based on the client's historical device code and the currently acquired device code, and sends the normalized result of the device code mapping table to the client, thereby improving the uniformity of the device code and facilitating user maintenance and use.
[0059] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0061] Figure 1 is a diagram of an application environment for determining a device code according to an exemplary embodiment;
[0062] Figure 2 is a flowchart of a method for determining a device code according to an exemplary embodiment;
[0063] Figure 3 is a schematic diagram showing an application process of determining a device code according to an exemplary embodiment;
[0064] Figure 4 is a first exemplary flow chart showing querying historical data using a device code according to an exemplary embodiment;
[0065] Figure 5 is a second exemplary flow chart showing querying historical data using a device code according to an exemplary embodiment;
[0066] Figure 6 is a first exemplary structural diagram of an apparatus for determining a device code according to an exemplary embodiment;
[0067] Figure 7 is a structural diagram of an electronic device according to an exemplary embodiment;
[0068] Figure 8 is a structural diagram of a device for determining a device code according to an exemplary embodiment;
[0069] Fig. 9 The figure is a structural diagram of another apparatus for determining a device code according to an exemplary embodiment. DETAILED DESCRIPTION
[0070] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0071] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0072] The method for determining the device code provided in the present disclosure can be applied to Figure 1 In the application environment shown. Among them, at least one client 11 and a server 12 communicate through a network. At least one client runs in the client 11. The client is implemented as an application with a need to obtain a device code. The client in the client 11 and the server 12 respectively have the ability to generate a device code. Among them, the client 11 can include but is not limited to various personal computers, laptops, smart phones, tablet computers, etc. The server 12 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0073] In one embodiment, the client in the client 11 may be implemented as an application integrating at least one specific function. The application as a whole has the ability to generate a device code and the need to obtain a device code. For example, the client may be implemented as a larger application such as a social software platform, a short video platform, or a long video platform, and these larger applications themselves have the ability to generate a device code and the need to obtain a device code.
[0074] In another embodiment, the client in the client 11 can be implemented as: an application associated with at least one business party. Among them: the application has the ability to generate a device code, and the business party has the need to obtain the device code. For example, the business party is implemented as a functional plug-in, a small program, a mount program or a functional module of the client, etc. For example, the client can be implemented as a short video platform, and the business party is implemented as a comment module, a video recommendation module or an indicator analysis module in the short video platform, etc. The short video platform has the ability to generate a device code. The comment module, the video recommendation module or the indicator analysis module, as the respective business parties of the short video platform, have the need to obtain the device code in their respective business uses.
[0075] Figure 2 The figure is a flowchart of a method for determining a device code according to an exemplary embodiment. Figure 2 The method shown can be executed by the server.
[0076] like Figure 2 As shown, the method includes:
[0077] Step 101: receiving reported data from a client, wherein the reported data includes a first device code, and the first device code is a device code currently acquired by the client.
[0078] Here, the client may be implemented as an application integrating at least one specific function, or an application associated with at least one business party. The server receives the reported data including the first device code from the client via a network connection with the client.
[0079] The first device code is the device code currently obtained by the client. In an exemplary embodiment, when the server successfully sends the code to the client, the first device code is the device code obtained by the client from the server; when the server fails to send the code to the client (for example, the network connection between the server and the client fails), the first device code is the device code generated by the client.
[0080] Therefore, when the server successfully sends the code to the client, the client can use the device code obtained from the server to execute the service. When the server fails to send the code to the client, the client generates a device code to execute the service. The client uses the device code to execute the service, including the client itself using the device code to execute the service and the service party using the device code to execute the service. It can be seen that regardless of whether the server successfully sends the code, the client continues to have the device code for executing the service, thereby improving the stability of the service.
[0081] For example, when there is a need to use a device code on the client and there is currently no available device code (for example, an APP is installed or reinstalled for the first time on the client), the client attempts to obtain the first device code from the server. When the server successfully sends the code to the client, the client uses the first device code obtained from the server to execute various business applications. When the server fails to send the code to the client, the client generates a first device code based on its own capabilities, and uses the first device code generated by itself to execute various business applications. For example, business applications may include: advertising, video recommendations, indicator analysis, etc.
[0082] Specifically, the situation where the server fails to send a code to the client includes at least one of the following:
[0083] (1) The communication link between the client and the server is interrupted.
[0084] (2) The communication link between the client and the server remains connected, and the computing resources on the server are insufficient to generate the device code.
[0085] (3) The communication link between the client and the server remains connected, and the computing resources on the server are sufficient to generate the device code, but the server cannot generate the device code due to certain constraints (e.g., scheduled rest time).
[0086] A device code generation module may be integrated on the client. In the event that the server fails to send a code to the client, the client generates a first device code using the device code generation module according to a predetermined device factor and algorithm. For example, the device factor may include hardware parameters of the client, such as the International Mobile Equipment Identity (IMEI), the Mobile Equipment Identifier (MEID), the Media Access Control (MAC) address, the Universally Unique Identifier (UUI), etc. The device factor may also include software parameters of the client, such as the software version number, serial number, etc.
[0087] The above exemplary description is a typical example of the failure of the server to send a code to the client and the client generating the first device code. Those skilled in the art will appreciate that this description is merely exemplary and is not intended to limit the protection scope of the embodiments of the present invention.
[0088] Step 102: Determine a normalization result according to the first device code and the stored historical device code of the client.
[0089] The meaning of the normalization result is: a device code with a normalized effect determined based on the first device code and the stored historical device codes of the client. The normalized device code is the device code to which the first device code and the stored historical device codes of the client are mapped together. Among them, the commonly mapped device code can be any one of the first device code and the stored historical device codes of the client, or one selected from the first device code and the stored historical device codes of the client based on a predetermined selection strategy. For example, the selection strategy may include: selection based on the timestamp of the device code, the frequency of use of the device code, the complexity of the device code, etc.
[0090] Step 103: Generate a device code mapping table based on the first device code, the historical device code and the normalization result, wherein the device code mapping table is used to instruct the client to obtain a target device code, which is a normalized result obtained by mapping the device code to be used by the client to the device code mapping table.
[0091] Here, the device code mapping table contains a mapping relationship between the normalization result and the device code set, wherein the device code set contains a first device code and a historical device code. The device code mapping table can be implemented by a data structure having a mapping relationship. Preferably, the device code mapping table can also contain content that characterizes the device code change process of the client, such as characterizing the device code change process of the client in a chain structure. The device code that the client is about to use means: the device code that the client is about to use when acquiring the target device code. Specifically, the device code that the client is about to use can be a device code that the client has used in history, a device code that the client has not used, or a device code that the client is currently using. Preferably, the device code that is about to be used can be implemented as the first device code in step 101.
[0092] It can be seen that the present disclosure combines the client device code generation method and the server device code generation method. When the device code cannot be obtained from the server, the client generates the device code, so the client still has an available device code, which improves the stability of the device code. In addition, a device code mapping table for determining the target device code is constructed based on the client's historical device code and the first device code. The device code mapping table can be used to send a normalized result as the target device code to the client, which also improves the uniformity of the device code and facilitates user maintenance and use.
[0093] In an exemplary embodiment, the reported data also includes a second device code, which is a device code that the client has obtained before. Step 102 and step 103 include: determining a normalization result according to the first device code, the second device code, and the stored historical device code of the client; and generating a device code mapping table according to the first device code, the second device code, the historical device code, and the normalization result.
[0094] It can be seen that the present disclosure determines the normalization result and generates the device code mapping table according to the first device code, the second device code and the historical device code, further enriches the content of the device code mapping table, and improves the uniformity of the device code.
[0095] In an exemplary embodiment, a device code mapping table is generated according to a first device code, a second device code, a historical device code, and a normalization result, including: determining a first edge, the first edge including the second device code as a starting point, and the first device code as an end point; when the acquisition time of the historical device code is earlier than the second device code, connecting the historical device code and the starting point to form a second edge, and when the acquisition time of the historical device code is later than the first device code, connecting the end point and the historical device code to form a second edge; generating the device code mapping table, the device code mapping table storing data pairs including keys and values, the values being the normalization results, and the keys including the starting point and end point of the first edge and the starting point and end point of the second edge.
[0096] Therefore, the present disclosure uses a connected graph algorithm based on point and edge establishment operations to quickly generate a device code mapping table, thereby reducing the difficulty of generating the device code mapping table.
[0097] In an exemplary embodiment, a normalization result is determined based on the first device code and the stored historical device code of the client, including: sorting the first device code and the historical device code based on device code attribute information; and selecting a normalization result from the sorted first device code and the historical device code based on a preset condition.
[0098] It can be seen that the present disclosure sorts the first device code and the historical device code based on the device code attribute information, and can use the device code attributes to determine flexible and diverse normalization results.
[0099] In an exemplary embodiment, the device code attribute information includes at least one of the following: device code timestamp; device code usage frequency; device code complexity.
[0100] Therefore, the present disclosure can determine the normalization result through various device code attribute information, thereby enriching the business flexibility.
[0101] In an exemplary embodiment, the method further includes: receiving a device code acquisition request including the device code to be used from the client; in response to the device code acquisition request, mapping the device code mapping table using the device code to be used to obtain the target device code; and sending a reply message including the target device code to the client. Preferably, the device code acquisition request can be received from the client via an online application programming interface (API), and the target device code can be returned to the client via the API, thereby reducing the device code jump phenomenon of the client.
[0102] For example, assuming that the device code that the client is about to use is ID4, the server receives a device code acquisition request containing ID4 from the client. The server uses ID4 to query the data structure containing<ID1,(ID1,ID2,ID3,ID4)> The server finds the normalized result as ID1 in the device code mapping table, and sends a reply message containing the normalized result (i.e., ID1) as the target device code to the client. The client parses ID1 from the reply message, updates the device code to be used from ID4 to ID1, and uses ID1 to execute the business application.
[0103] It can be seen that the present disclosure can respond to a device code acquisition request issued by a client, provide a target device code for the client, and can also reduce the operation complexity of the client.
[0104] In an exemplary embodiment, the method further includes: sending the device code mapping table to the client, wherein the client maps the device code mapping table using the device code to be used to obtain the target device code. The client can use the device code mapping table as offline data, thereby reducing the device code jump phenomenon of the client.
[0105] For example, the server sends a data structure to the client.<ID1,(ID1,ID2,ID3,ID4)> Assuming that the device code to be used by the client is ID4, the client uses ID4 to query the device code mapping table and finds that the normalized result of the target device code is ID1. The client updates the device code to be used from ID4 to ID1 and uses ID1 to execute the business application.
[0106] It can be seen that the client of the present disclosure can obtain the target device code by itself using the device code mapping table sent by the server, which reduces the processing pressure of the server and improves the autonomous control degree of the client.
[0107] In an exemplary embodiment, the method also includes: the server receives a historical data acquisition request containing a first device code from the client; the server sends a reply message containing historical data to the client, wherein the historical data is a target device code as a normalized result obtained by querying a device code mapping table using the first device code on the server, and business data associated with a business application of the target device code obtained by querying a historical database using the target device code.
[0108] It can be seen that the present disclosure can obtain historical data with continuity on the client side by returning the historical data obtained by querying the historical database using the target device code to the client side, thereby indicating the continuity and stability of the business scenario. Moreover, even if the client does not update the first device code using the target device code in a timely manner (for example, due to insufficient client processing resources, it is not updated in a timely manner), it can still obtain historical data associated with the business application of the target device code, thereby ensuring the continuity of the historical data provided to the client side, and further indicating the continuity and stability of the business scenario.
[0109] The present disclosure provides a device code mapping (MAPPING) service framework, including bottom-level data point reporting, device code change link construction and upper-level device code mapping service provision. In the event that the server fails to send the code, the device code is generated by the client, and the normalized result as the target device code can also be provided to the client (for example, in the form of an offline data table, online API service, etc.). Specifically including:
[0110] (1) If the server fails to send the code, it will downgrade to the client sending the code and storing the data (involving the reporting of the underlying data point).
[0111] The data point reporting mechanism of the client is described. The client implements the data reporting function, and the basic structure is <second device code, first device code>. In this embodiment, the second device code can be the device code used before the change, and the first device code is the device code after the change. When the device code changes, both the first device code and the second device code are reported to the server, and the reported content can also include other data such as timestamp and device information.
[0112] (2) After the network environment is restored, the client reports the changes in the device code to the server (involving the establishment of a link for changes in the device code).
[0113] The following describes the link construction for device code changes. After receiving the data reported by the client, the server processes the data in combination with the client's historical device code stored on the server to form a device code mapping table containing a chain structure representing device code changes, and the chain structure has a normalized result, namely the target device code.
[0114] For example, suppose the chain structure saved on the server is<ID1,(ID1,ID2)> , where ID1 and ID2 are the historical device codes stored on the server and the client, respectively. Moreover, ID1 is the normalized result determined from ID1 and ID2 based on a predetermined principle (for example, based on the principle of the highest frequency of device code use). The data reported by the client this time is<ID3,ID4> , where ID4 is the current device code generated by the client itself (ie, the first device code), and ID3 is the device code that has been obtained and saved by the client, such as the device code used before ID4 (ie, the second device code).
[0115] The server aggregates the client's reported data and the existing chain structure (for example, involving a connected graph algorithm) to form a<ID1,(ID1,ID2,ID3,ID4)> The updated data structure (such as a data table form) is generated, and the updated data structure is stored in a database / data warehouse. Exemplarily, the data aggregation process based on the connectivity graph algorithm includes: (1) determining a first edge, the first edge including ID3 as a starting point and ID4 as an end point. (2) based on the acquisition time of ID1 or ID2, connecting ID1 or ID2 to ID3 and ID4 respectively to determine two second edges, wherein when the acquisition time of ID1 or ID2 is earlier than that of ID3, connecting ID3 with ID1 or ID2 as the starting point to form a second edge; when the acquisition time of ID1 or ID2 is later than that of ID4, connecting ID1 or ID2 with ID4 as the starting point to form a second edge. (3) based on the minimum connectivity graph including the first edge and the two second edges, generating a<ID1,(ID1,ID2,ID3,ID4)> The device code mapping table of the updated data structure, in which the device codes in (ID1, ID2, ID3, ID4) are sorted in order according to the acquisition time. In the updated data structure, ID1 is the normalized device code (for example, based on the principle of the highest frequency of device code use, the device code with the highest frequency of use (assuming ID1) is selected from ID1, ID2, ID3, and ID4 as the normalized device code of the chain structure), and the normalized device code is the target device code of the client. When any one of ID1, ID2, ID3, and ID4 is used as a search item to query the data structure, ID1 is hit as the query result.
[0116] For another example, suppose the chain structure saved on the server is<ID2,(ID1,ID2,ID6)> , where ID1, ID2 and ID6 are the historical device codes stored on the server and the client respectively. Moreover, ID2 is the normalized result determined from ID1, ID2 and ID6 based on a predetermined principle (for example, based on the earliest device code generation time principle). The data reported by the client this time is<ID3,ID4> , where ID4 is the current device code generated by the client itself (i.e., the first device code), and ID3 is the device code that the client has saved and obtained before (i.e., the second device code), such as the device code used before ID4. The server aggregates the client's reported data and the existing chain structure (for example, involving a connected graph algorithm) to form a structure such as<ID3,(ID1,ID2,ID3,ID4,ID6)> The updated data structure (such as a data table form) is generated, and the updated data structure is stored in a database / data warehouse. Exemplarily, the data aggregation process based on the connectivity graph algorithm includes: (1) determining a first edge, the first edge including ID3 as a starting point and ID4 as an end point. (2) based on the acquisition time of ID1, ID2 or ID6, connecting ID1, ID2 or ID6 to ID3 and ID4 respectively to determine three second edges, wherein when the acquisition time of ID1, ID2 or ID6 is earlier than that of ID3, connecting ID3 with ID1, ID2 or ID6 as the starting point to form a second edge; when the acquisition time of ID1, ID2 or ID6 is later than that of ID4, connecting ID1, ID2 or ID6 with ID4 as the starting point to form a second edge. (3) based on the minimum connectivity graph including the first edge and the three second edges, generating a<ID3,(ID1,ID2,ID3,ID4,ID6)> The device code mapping table of the updated data structure, wherein each device code in (ID1, ID2, ID3, ID4, ID6) is sorted in order according to the acquisition time. In the updated data structure, ID3 is the normalized device code (for example, based on the principle of the earliest device code generation time, the device code with the earliest generation time (such as ID3) is selected from ID1, ID2, ID3, ID4, and ID6 as the normalized device code of the chain structure), and the normalized device code is the target device code of the client. When any one of ID1, ID2, ID3, ID4, and ID6 is used as a search item to query the data structure, ID3 will be hit as the query result.
[0117] (3) Provide mapping services so that the client can obtain the chain change process of the device code and reduce the negative impact on the business.
[0118] For example, based on a data structure such as <ID1,(ID2,ID3,ID4)>, a device code mapping service func can be provided. The main functions of the device code mapping service func include: when the client uses any one of ID2, ID3, and ID4 to request the mapping service func, the mapping service func can return ID1 by querying the data structure, that is, the normalized result (i.e., the target device code) of the chain structure to which the ID belongs. For example, func(ID2) = ID1.
[0119] For another example, for a client on the server, the data structure is <ID1,(ID1,ID2,ID3,ID4)>, which means that the client has used ID1, ID2, ID3, and ID4 as device codes in the past. When any one of ID1, ID2, ID3, and ID4 is used as a search item to call the device code mapping service func, func can return ID1 by querying the data structure, that is, the normalized result (i.e., the target device code) of the chain structure to which the ID belongs. For example, func(ID3) = ID1.
[0120] In summary, the present disclosure can not only maintain the advantages of the server issuing codes but also handle the failure of code issuance caused by network transmission or other abnormal attacks, and can obtain a stable and available device code without manual intervention.
[0121] Figure 3 It is an application schematic diagram of determining a device code shown according to an exemplary embodiment.
[0122] The client is associated with business party 1, business party 2, ... business party m. Each business party has its own business scenario, which are business scenario 1, business scenario 2, ... business scenario m. In step 301, the client reports <second device code, first device code>. In step 302, the server constructs a device code mapping table containing a data structure: <normalized result, (first device code, second device code, historical device code)>. Among them, the normalized result can be a device code selected from the first device code, the second device code and the historical device code based on selection factors such as the frequency order of using the device code or the time order of device code generation. In step 303, the server provides a data code mapping service based on the device code mapping table. In the data code mapping service, when the search item contains any one of the first device code, the second device code or the historical device code, the normalized result is returned. In step 304, when any business party in business scenario 1, business scenario 2, ... business scenario m has a need to obtain a device code, the client sends a query request containing a first device code to the server, and the server returns a normalized result as a target device code to the client based on the data code mapping service, and the client then sends the target device code to the business party with the need to obtain a device code. Then, the business party with the need to obtain a device code can apply the target device code in its respective business scenario.
[0123] The present disclosure is described in an actual scenario. Assume that APP 123 uses the device code generation scheme described in the present disclosure. When APP 123 is installed on the client for the first time, the server generates the client's device code (indicated by ID1). The server successfully sends the code to the client, and the client reports<ID1,ID1> To the server, the server forms a device code mapping table with a chain structure containing device codes. The chain structure is:<ID1,(ID1)> When the client deletes APP 123 and then reinstalls APP 123, the server generates the client's device code (for example, ID6) again. Due to the network failure, the server fails to send the code to the client and downgrades to the client code sending method. The client generates the device code of APP 123 (indicated by ID2) by itself and uses the device code (ID2) generated by itself to perform business. When the network between the client and the server is restored, the client reports to the server<ID1,ID2> To the server, where ID2 is the device code currently in use and generated by the client, and ID1 is the device code saved by the client and generated by the server and used in the past. The server forms a device code mapping table containing an update chain structure of device codes, and the update chain structure is:<ID1,(ID1,ID2)> , where ID1 is selected from (ID1, ID2) based on the earliest device code generation time. Next, the server returns the normalized result of ID2, that is, ID1, through the device code mapping service, and returns ID1 to the client as the target device code. The client can then replace ID2 with ID1, and it can be seen that the client's device code is updated to ID1 with the earliest generation time. Moreover, the server returns the historical data obtained using ID1 to APP123, so that APP 123 can be provided with earlier historical data, which improves the continuity and stability of the business scenario.
[0124] Figure 4 FIG. 1 is a first exemplary flow chart showing how to query historical data using a device code according to an exemplary embodiment. Figure 4 As shown, the method includes:
[0125] Step 401: When the client cannot obtain the device code from the server, the client generates a first device code.
[0126] Step 402: The client sends the reporting data including the first device code and the second device code to the server.
[0127] Step 403: The server constructs a device code mapping table including a chain data structure on the server based on the reported data and the historical device codes stored on the server, wherein the chain data structure is adapted to instruct the client to obtain a target device code, which is a normalized result obtained by mapping the device code to be used by the client (for example, the first device code) to the device code mapping table.
[0128] Step 404: The server receives a query request including a first device code from the client.
[0129] Step 405: The server uses the first device code to query the data structure in the device code mapping table on the server to obtain the normalization result, and sends a reply message containing the normalization result as the target device code to the client. The client updates the first device code using the target device code. Then, the client uses the target device code to perform services related to the device code (for example, the client itself performs services related to the device code, or a service party associated with the client performs services related to the device code).
[0130] Step 406: After the client updates the first device code with the target device code, the server receives a historical data acquisition request including the target device code from the client.
[0131] Step 407: The server uses the target device code to query the history database to obtain history data associated with the historical business operations of the target device code;
[0132] Step 408: The server sends a reply message containing historical data to the client.
[0133] exist Figure 4 During the process, the client can use the target device code provided by the server to obtain historical data.
[0134] Figure 5 FIG. 1 is a second exemplary flow chart showing how to query historical data using a device code according to an exemplary embodiment. Figure 5 As shown, the method includes:
[0135] Step 501: When the client cannot obtain the device code from the server, the client generates a first device code.
[0136] Step 502: The client sends the reporting data including the first device code and the second device code to the server.
[0137] Step 503: The server constructs a device code mapping table including a chain data structure on the server based on the reported data and the historical device codes stored on the server, wherein the chain data structure is adapted to instruct the client to obtain a target device code, which is a normalized result obtained by mapping the device code to be used by the client (for example, the first device code) to the device code mapping table.
[0138] Step 504: The server receives a query request including a first device code from the client.
[0139] Step 505: The server uses the first device code to query the data structure in the device code mapping table on the server to obtain the normalization result, and sends a reply message containing the normalization result as the target device code to the client. The client is using the first device code to process the service, and has not used the target device code to update the first device code.
[0140] Step 506: During a period when the client does not update the first device code using the target device code, the server receives a historical data acquisition request including the first device code from the client.
[0141] Step 507: The server uses the first device code to query the data structure in the device code mapping table to obtain a normalized result as the target device code, and uses the target device code to query the history database to obtain history data associated with the historical business operations of the target device code.
[0142] Step 508: The server sends a reply message containing historical data to the client.
[0143] exist Figure 5 During the process, the client can use the first device code generated by itself to obtain historical data, and can obtain comprehensive historical data without updating the device code.
[0144] Figure 6 FIG. 1 is a first exemplary structural diagram of an apparatus for determining a device code according to an exemplary embodiment. Figure 6 As shown, the device code determination device 600 includes:
[0145] The receiving module 601 is configured to receive the reported data from the client, where the reported data includes a first device code, where the first device code is the device code currently obtained by the client;
[0146] The determination module 602 is configured to determine a normalization result according to the first device code and the stored historical device codes of the client;
[0147] The generation module 603 is configured to generate a device code mapping table based on the first device code, the historical device code and the normalization result. The device code mapping table is used to instruct the client to obtain the target device code. The target device code is the normalized result obtained after mapping the device code to be used by the client to the device code mapping table.
[0148] In an exemplary embodiment, when the code is successfully sent to the client, the first device code is a device code obtained by the client from the server; when the code is failed to be sent to the client, the first device code is a device code generated by the client.
[0149] In an exemplary embodiment, the reported data also includes a second device code, which is a device code that the client has obtained before; the generation module 603 is configured to: determine the normalization result based on the first device code, the second device code and the stored historical device code of the client; generate a device code mapping table based on the first device code, the second device code, the historical device code, and the normalization result.
[0150] In an exemplary embodiment, the generation module 603 is configured to: determine a first edge, the first edge including the second device code as a starting point, and the first device code as an end point; in a case where the acquisition time of the historical device code is earlier than the second device code, connect the historical device code and the starting point to form a second edge, and in a case where the acquisition time of the historical device code is later than the first device code, connect the end point and the historical device code to form the second edge; generate a device code mapping table, the device code mapping table stores data pairs including keys and values, the values are normalized results, and the keys include the starting point and end point of the first edge and the starting point and end point of the second edge.
[0151] In an exemplary embodiment, the determination module 602 is configured to: sort the first device code and the historical device code based on the device code attribute information; and select a normalized result from the sorted first device code and the historical device code based on a preset condition.
[0152] In an exemplary embodiment, the device code attribute information includes at least one of the following: device code timestamp; device code usage frequency; device code complexity.
[0153] In an exemplary embodiment, the receiving module 601 is configured to receive a device code acquisition request including a device code to be used from a client; the apparatus 600 further includes:
[0154] The sending module 604 is configured to: in response to the device code acquisition request, map the device code to be used to the device code mapping table to obtain the target device code; and send a reply message including the target device code to the client.
[0155] In an exemplary embodiment, the apparatus 600 further includes a sending module 604 configured to send the device code mapping table to the client, wherein the client maps the device code mapping table with the device code to be used to obtain a target device code.
[0156] The embodiment of the present disclosure also provides an electronic device. Figure 7 FIG. 1 is a structural diagram of an electronic device according to an exemplary embodiment. Figure 7 As shown, the electronic device 800 may include: a processor 801; a memory 802 for storing executable instructions of the processor 801; wherein the processor 801 is configured to: when executing the executable instructions stored in the memory 802, implement the method for determining the device code provided in the embodiment of the present disclosure.
[0157] It can be understood that the electronic device 800 can be a server or a terminal device. In specific applications, the terminal device can be a mobile phone, a computer, a digital broadcast terminal, a message transceiver, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0158] Figure 8 900 is a structural diagram of an apparatus for determining a device code according to an exemplary embodiment. For example, the apparatus 900 may be: a smart phone, a tablet computer, a Moving Picture Experts Group Audio Layer III (MP3) player, a Moving Picture Experts Group Audio Layer IV (MP4) player, a laptop computer or a desktop computer. The apparatus 900 may also be referred to as a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.
[0159] Typically, the device 900 includes: a processor 901 and a memory 902. The processor 901 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 901 may be implemented in at least one hardware form of digital signal processing (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor 901 may also include a main processor and a coprocessor, the main processor is a processor for processing data in an awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 901 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 901 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0160] The memory 902 may include one or more computer-readable storage media, which may be non-transitory. The memory 902 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 902 is used to store at least one instruction, which is used to be executed by the processor 901 to implement the method for determining the device code provided in each embodiment of the present disclosure. In some embodiments, the device 900 may also optionally include: a peripheral device interface 903 and at least one peripheral device. The processor 901, the memory 902 and the peripheral device interface 903 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 903 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 904, a touch display screen 905, a camera assembly 906, an audio circuit 907, a positioning assembly 908 and a power supply 909.
[0161] The peripheral device interface 903 can be used to connect at least one peripheral device related to input / output (I / O) to the processor 901 and the memory 902. In some embodiments, the processor 901, the memory 902 and the peripheral device interface 903 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 901, the memory 902 and the peripheral device interface 903 can be implemented on a separate chip or circuit board, which is not limited in the embodiments of the present disclosure. The radio frequency circuit 904 is used to receive and transmit radio frequency (RF) signals, also known as electromagnetic signals. The radio frequency circuit 904 communicates with communication networks and other communication devices through electromagnetic signals. The radio frequency circuit 904 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 904 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The radio frequency circuit 904 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: metropolitan area network, mobile communication networks of various generations (2G, 3G, 4G and 5G), wireless local area network and / or wireless fidelity (Wireless Fidelity, WiFi) network. In some embodiments, the radio frequency circuit 904 may also include circuits related to near field communication (NFC), which is not limited in the embodiments of the present disclosure.
[0162] The display screen 905 is used to display a user interface (UI). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 905 is a touch display screen, the display screen 905 also has the ability to collect touch signals on the surface or above the surface of the display screen 905. The touch signal can be input to the processor 901 as a control signal for processing. At this time, the display screen 905 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 905 can be one, and the front panel of the device 900 is set; in other embodiments, the display screen 905 can be at least two, which are respectively set on different surfaces of the device 900 or are folded; in some other embodiments, the display screen 905 can be a flexible display screen, which is set on the curved surface or folded surface of the device 900. Even, the display screen 905 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 905 can be made of materials such as a liquid crystal display (LCD) and an organic light-emitting diode (OLED). The camera component 906 is used to collect images or videos. Optionally, the camera assembly 906 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and virtual reality (VR) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 906 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0163] The audio circuit 907 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 901 for processing, or input them into the RF circuit 904 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the device 900. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 901 or the RF circuit 904 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into a sound wave audible to humans, but also convert the electrical signal into a sound wave inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 907 may also include a headphone jack. The positioning component 908 is used to locate the current geographical location of the device 900 to achieve navigation or location-based services (LBS). Positioning component 908 can be a positioning component based on the Global Positioning System (GPS) of the United States, the Beidou system of China, the Grenas system of Russia, or the Galileo system of the European Union. Power supply 909 is used to power the various components in device 900. Power supply 909 can be alternating current, direct current, a disposable battery, or a rechargeable battery. When power supply 909 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also support fast charging technology.
[0164] In some embodiments, the device 900 further includes one or more sensors 910. The one or more sensors 910 include, but are not limited to, an acceleration sensor 911, a gyroscope sensor 912, a pressure sensor 913, a fingerprint sensor 914, an optical sensor 915, and a proximity sensor 916. The acceleration sensor 911 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the device 900. For example, the acceleration sensor 911 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 901 can control the touch display screen 905 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 911. The acceleration sensor 911 can also be used for the collection of motion data of games or users. The gyroscope sensor 912 can detect the body direction and rotation angle of the device 900, and the gyroscope sensor 912 can cooperate with the acceleration sensor 911 to collect the user's 3D actions on the device 900. The processor 901 can implement the following functions based on the data collected by the gyroscope sensor 912: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation. The pressure sensor 913 can be set on the side frame of the device 900 and / or the lower layer of the touch display screen 905. When the pressure sensor 913 is set on the side frame of the device 900, the user's holding signal of the device 900 can be detected, and the processor 901 performs left and right hand recognition or shortcut operations based on the holding signal collected by the pressure sensor 913. When the pressure sensor 913 is set on the lower layer of the touch display screen 905, the processor 901 controls the operability controls on the UI interface according to the user's pressure operation on the touch display screen 905. The operability controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.
[0165] The fingerprint sensor 914 is used to collect the user's fingerprint, and the processor 901 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 914, or the fingerprint sensor 914 identifies the user's identity based on the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 901 authorizes the user to perform relevant sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. The fingerprint sensor 914 can be set on the front, back, or side of the device 900. When a physical button or a manufacturer logo is set on the device 900, the fingerprint sensor 914 can be integrated with the physical button or the manufacturer logo. The optical sensor 915 is used to collect the ambient light intensity. In one embodiment, the processor 901 can control the display brightness of the touch display screen 705 according to the ambient light intensity collected by the optical sensor 915. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 905 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 905 is reduced. In another embodiment, the processor 901 may also dynamically adjust the shooting parameters of the camera assembly 906 according to the ambient light intensity collected by the optical sensor 915. The proximity sensor 916, also known as a distance sensor, is usually arranged on the front panel of the device 900. The proximity sensor 916 is used to collect the distance between the user and the front of the device 700. In one embodiment, when the proximity sensor 916 detects that the distance between the user and the front of the device 700 is gradually decreasing, the processor 901 controls the touch display screen 905 to switch from the screen-on state to the screen-off state; when the proximity sensor 916 detects that the distance between the user and the front of the device 900 is gradually increasing, the processor 901 controls the touch display screen 905 to switch from the screen-off state to the screen-on state.
[0166] Those skilled in the art will appreciate that the above structure does not limit the device 900 , and the device 900 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different arrangement of components.
[0167] Fig. 9 1 is a structural diagram of another apparatus for determining a device code according to an exemplary embodiment. For example, the apparatus 1000 may be provided as a server. Fig. 9 , the apparatus 1000 includes a processing component 1001, which further includes one or more processors, and a memory resource represented by a memory 1002, for storing instructions executable by the processing component 1001, such as an application. The application stored in the memory 1002 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1001 is configured to execute instructions to perform the above-mentioned method for determining the device code.
[0168] The device 1000 may further include a power supply component 1003 configured to perform power management of the device 1001, a wired or wireless network interface 1004 configured to connect the device 1000 to a network, and an input-output interface 1005. The device 1000 may operate based on an operating system stored in the memory 1002, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD or the like.
[0169] In addition, the embodiment of the present application also provides a non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can perform the steps of the device code determination method provided in the embodiment of the present application. Computer-readable storage media may include, but are not limited to: portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above, but are not used to limit the scope of protection of the present invention. In the embodiments disclosed in the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus or device.
[0170] In addition, an embodiment of the present application further provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device is enabled to execute the steps of the above-mentioned method for determining a device code.
[0171] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0172] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A method for determining a device code, characterized in that: include: Receiving reported data from a client, where the reported data includes a first device code, where the first device code is a device code currently acquired by the client; Determine a normalization result according to the first device code and the stored historical device code of the client; Generate a device code mapping table according to the first device code, the historical device code and the normalization result, wherein the device code mapping table is used to instruct the client to obtain a target device code, wherein the target device code is a normalization result obtained by mapping the device code to be used by the client to the device code mapping table; Receive a historical data acquisition request containing a first device code from a client; send a reply message containing historical data to the client, wherein the historical data is business data associated with a business application of the target device code obtained by querying a device code mapping table using the first device code on the server side to obtain a target device code as a normalized result, and querying a historical database using the target device code.
2. The method according to claim 1, characterized in that When the code is successfully sent to the client, the first device code is the device code obtained by the client from the server; In the case where sending a code to the client fails, the first device code is a device code generated by the client.
3. The method according to claim 1, characterized in that The reported data further includes a second device code, where the second device code is a device code that the client has acquired; The determining the normalization result according to the first device code and the stored historical device code of the client, and generating a device code mapping table according to the first device code, the historical device code and the normalization result, includes: Determining the normalization result according to the first device code, the second device code, and the stored historical device code of the client; The device code mapping table is generated according to the first device code, the second device code, the historical device code, and the normalization result.
4. The method according to claim 3, characterized in that The generating the device code mapping table according to the first device code, the second device code, the historical device code, and the normalization result includes: determining a first edge, the first edge including the second device code as a starting point and the first device code as an end point; If the acquisition time of the historical device code is earlier than that of the second device code, the historical device code is connected to the starting point to form a second edge, and if the acquisition time of the historical device code is later than that of the first device code, the end point is connected to the historical device code to form a second edge; The device code mapping table is generated, wherein the device code mapping table stores data pairs including keys and values, wherein the values are the normalized results, and the keys include the start point and the end point of the first edge and the start point and the end point of the second edge.
5. The method according to claim 1, characterized in that The determining a normalization result according to the first device code and the stored historical device code of the client includes: sorting the first device code and the historical device code based on device code attribute information; Based on a preset condition, the normalization result is selected from the sorted first device codes and the historical device codes.
6. The method according to claim 5, characterized in that The device code attribute information includes at least one of the following: Device code timestamp; device code usage frequency; device code complexity.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: receiving, from the client, a device code acquisition request including the device code to be used; In response to the device code acquisition request, mapping the device code mapping table using the device code to be used to obtain the target device code; A reply message including the target device code is sent to the client.
8. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: The device code mapping table is sent to the client, where the device code mapping table is used to instruct the client to map the device code mapping table with the device code to be used to obtain the target device code.
9. A device for determining a device code, characterized in that: include: A receiving module is configured to receive reported data from a client, wherein the reported data includes a first device code, and the first device code is a device code currently acquired by the client; a determination module, configured to determine a normalization result according to the first device code and the stored historical device code of the client; a generating module configured to generate a device code mapping table according to the first device code, the historical device code and the normalization result, wherein the device code mapping table is used to instruct the client to obtain a target device code, wherein the target device code is a normalization result obtained by mapping the device code to be used by the client to the device code mapping table; The receiving module is configured to receive a historical data acquisition request containing a first device code from a client; the generating module is configured to send a reply message containing historical data to the client, wherein the historical data is the target device code as a normalized result obtained by querying a device code mapping table using the first device code on the server, and the business data associated with the business application of the target device code obtained by querying a historical database using the target device code.
10. The device according to claim 9, characterized in that When the code is successfully sent to the client, the first device code is the device code obtained by the client from the server; In the case where sending a code to the client fails, the first device code is a device code generated by the client.
11. The device according to claim 9, characterized in that The reported data further includes a second device code, where the second device code is a device code that the client has acquired; The generation module is configured as follows: Determining the normalization result according to the first device code, the second device code, and the stored historical device code of the client; The device code mapping table is generated according to the first device code, the second device code, the historical device code, and the normalization result.
12. The device according to claim 11, characterized in that The generation module is configured as follows: determining a first edge, the first edge including the second device code as a starting point and the first device code as an end point; If the acquisition time of the historical device code is earlier than that of the second device code, the historical device code is connected to the starting point to form a second edge, and if the acquisition time of the historical device code is later than that of the first device code, the end point is connected to the historical device code to form a second edge; The device code mapping table is generated, wherein the device code mapping table stores data pairs including keys and values, wherein the values are the normalized results, and the keys include the start point and the end point of the first edge and the start point and the end point of the second edge.
13. The device according to claim 9, characterized in that The determination module is configured to: sorting the first device code and the historical device code based on device code attribute information; Based on a preset condition, the normalized result is selected from the sorted first device codes and the historical device codes.
14. The device according to claim 13, characterized in that The device code attribute information includes at least one of the following: Device code timestamp; device code usage frequency; device code complexity.
15. The device according to any one of claims 9 to 14, characterized in that The receiving module is configured to receive a device code acquisition request including the device code to be used from the client; the apparatus further includes: The sending module is configured to: in response to the device code acquisition request, map the device code mapping table using the device code to be used to obtain the target device code; and send a reply message containing the target device code to the client.
16. The device according to any one of claims 9 to 14, characterized in that The device also includes: The sending module is configured to send the device code mapping table to the client, wherein the client maps the device code mapping table with the device code to be used to obtain the target device code.
17. An electronic device, characterized in that: The electronic device includes: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the executable instructions to implement the method for determining the device code according to any one of claims 1 to 8.
18. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the computer instructions are executed by a processor, the method for determining the device code according to any one of claims 1 to 8 is implemented.
19. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the method for determining the device code according to any one of claims 1 to 8.
Citation Information
Patent Citations
Device code generation method and apparatus, device and storage medium
CN108881513A