Data smooth switching method, device, terminal equipment and readable storage medium
By using the data of the new data source as the running data, synchronously processed with the main data and compared the user portrait differences, and adjusting the generation method logic, the problem of inconsistent results after external data access is solved, and the consistency and production stability of the new data source and the main data effect are achieved.
Patent Information
- Application Number
- CN202510008471.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2045-01-03
AI Technical Summary
There are differences in the data formats and types of different external data providers, which makes it difficult to produce the same results as local master data after external data access, affecting actual use.
By using the data of the new data source as the running data, when called at the same time as the main data, the user portrait is synchronized and generated, the differences between the two are compared, and the logic of the user portrait generation method is adjusted to make it consistent within the expected range.
The new data source can produce the same effect as the main data, save the adaptation time of new data and ensure the stability of production work.
Smart Images

Figure CN119396805B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data backup, and in particular to a method, device, terminal equipment and readable storage medium for smooth data switching. Background Art
[0002] The core of risk control is to control user risks. Rich user portrait data makes risk strategies more robust and complete. Data is the foundation of risk control. All industries will accumulate some data. If only in-line data is used, it is far from enough. Therefore, it is necessary to access external data to enrich user portrait data. Considering the stability of business development, it is necessary to reserve important external data in advance and access multiple data providers in the same field. However, the data formats and types provided by different suppliers are different. It is often difficult to produce the same results as local master data after external data is accessed, which affects actual use. Summary of the invention
[0003] In view of this, the embodiments of the present application provide a method, apparatus, terminal device and readable storage medium for smooth data switching, which can effectively solve the problem that the new data source does not produce the same effect.
[0004] In a first aspect, an embodiment of the present application provides a data smooth switching method, including:
[0005] When a new data source is connected, the data of the new data source is used as accompanying data;
[0006] When the current master data is called, the accompanying data is synchronously called, and the same user portrait generation method is adopted to obtain the first user portrait of the current master data and the second user portrait of the accompanying data;
[0007] Obtaining a difference between the first user portrait and the second user portrait, and determining whether the difference is within an expected range;
[0008] If it is not within the expected range, adjusting the logic of the user portrait generation method according to the difference;
[0009] If it is within the expected range, it is determined that the first user portrait and the second user portrait are the same, and the data of the new data source is used as backup data.
[0010] In one embodiment, obtaining the difference between the first user portrait and the second user portrait includes:
[0011] Taking the first user portrait as a reference, determining whether the same type of data is the same between the second user portrait and the first user portrait;
[0012] Determine all different data in the second user portrait and the first user portrait, where all the different data are the differences between the first user portrait and the second user portrait.
[0013] In one embodiment, determining whether the difference is within an expected range includes:
[0014] Determine the difference between different data types;
[0015] If all of the difference types are acceptable difference types, it is determined that the difference is within the expected range; otherwise, it is determined that the difference is not within the expected range.
[0016] In one embodiment, the user portrait generation method includes:
[0017] Performing format processing on the input data and extracting target feature data from the data;
[0018] Data cleaning and logical processing are performed on each of the target feature data to obtain a user portrait.
[0019] In one embodiment, the method further comprises:
[0020] When the current primary data fails to be called, the backup data is switched to be called, and a corresponding user portrait is generated according to the backup data.
[0021] In one embodiment, adjusting the logic of the user portrait generation method according to the difference includes:
[0022] determining the difference type of the difference;
[0023] According to the difference types, locate the relevant processing logic of the current user portrait generation method;
[0024] The relevant processing logic is modified so that the data of the second user portrait is the same as the data of the first user portrait.
[0025] In one embodiment, the types of differences include: missing data and numerical errors;
[0026] The modifying the related processing logic includes:
[0027] If the difference type is missing data, determining the missing data type, and modifying the relevant processing logic for identifying the data type so that the data type can be correctly identified;
[0028] If the difference type is the numerical error, the data source of the current erroneous data is determined. If the data source exists, the relevant processing logic of data writing is modified. If the data source does not exist, the processing logic related to the numerical processing is modified.
[0029] In a second aspect, the present application further provides a data smooth switching device, comprising:
[0030] An accompanying module is used to use the data of a new data source as accompanying data when a new data source is accessed;
[0031] A user portrait generation module is used to synchronously call the accompanying data when the current main data is called, and adopt the same user portrait generation method to obtain a first user portrait of the current main data and a second user portrait of the accompanying data;
[0032] A judgment module, used to obtain a difference between the first user portrait and the second user portrait, and determine whether the difference is within an expected range;
[0033] An adjustment module, used for adjusting the logic of the user portrait generation method according to the difference if it is not within the expected range;
[0034] A backup module is used to determine that the first user portrait and the second user portrait are the same if they are within the expected range, and use the data of the new data source as backup data.
[0035] In a third aspect, the present application further provides a terminal device, the terminal device comprising a processor and a memory, the memory storing a computer program, and the processor being used to execute the computer program to implement the data smooth switching method.
[0036] In a fourth aspect, the present application further provides a computer-readable storage medium storing a computer program, which, when executed on a processor, implements the data smooth switching method.
[0037] The embodiments of the present application have the following beneficial effects:
[0038] This application compares the user portraits of the new data source and the master data in the actual production workflow, thereby adjusting the logic of the user portrait generation method so that the new data source can produce the same effect as the master data. The entire adjustment process does not take up extra time, saving the adaptation time of the new data, and can ensure that the effect of the new data source is the same as the master data, ensuring the stability of production work. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 A schematic diagram of a data smooth switching method according to an embodiment of the present application is shown;
[0041] Figure 2 A schematic diagram of a risk control process in an embodiment of the present application is shown;
[0042] Figure 3 A structural schematic diagram of a data smooth switching device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0043] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0044] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0045] Hereinafter, the terms "including", "having" and their cognates that can be used in various embodiments of the present application are intended only to indicate specific features, numbers, steps, operations, elements, components or a combination of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or a combination of the foregoing items or increasing the possibility of one or more features, numbers, steps, operations, elements, components or a combination of the foregoing items. In addition, the terms "first", "second", "third" and the like are only used to distinguish descriptions and cannot be understood as indicating or implying relative importance.
[0046] Unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which various embodiments of the present application pertain. The terms (such as those defined in a general-use dictionary) will be interpreted to have the same meaning as their contextual meaning in the relevant technical field and will not be interpreted to have an idealized or overly formal meaning unless clearly defined in various embodiments of the present application.
[0047] In order to enable new external data to be put into use as soon as it comes in and to make the user feel no difference when switching between the external data and the local master data. The present application provides a data smooth switching method. By using the data of the newly received external data source as co-running data, the same logic is executed together with the master data when processing services, and based on the difference between the two user portraits generated from the master data, a comparison is made to change the generation logic of the user portrait, so that the user portrait generated from the master data is the same as the user portrait generated from the new data. Finally, the data of the new data source can be used as backup data and added to production.
[0048] The following will describe in detail some embodiments of the present application with reference to the accompanying drawings. Without conflict, the following embodiments and the features in the embodiments may be combined with each other.
[0049] The following will illustrate the data smooth switching method with some specific embodiments.
[0050] Figure 1 A flowchart showing the data smooth switching method according to an embodiment of the present application is shown. Exemplarily, the data smooth switching method includes the following steps:
[0051] Step S100, when accessing a new data source, use the data of the new data source as co-running data.
[0052] The method of this embodiment is applied to a risk control system, which needs to generate a user portrait based on user data to provide a basis for risk assessment of users. The new data source in this embodiment is external data that has not been used by the current risk control system.
[0053] The purpose of adding new data is to form a more stable and effective user portrait for users by combining data from multiple data sources, but the newly added data cannot be directly used in the production environment. Therefore, in this embodiment, the data of the new data source is first saved in the system as co-running data.
[0054] Step S200, when the current master data is called, synchronously call the co-running data and use the same user portrait generation method to obtain the first user portrait of the current master data and the second user portrait of the co-running data.
[0055] When the current master data is called, it means that the risk control system needs to generate a user profile for a certain user. At this time, the data of the new data source previously used as the accompanying data will also be called synchronously. The same user profile generation method will be executed for both the accompanying data and the master data to obtain the user profile generation method.
[0056] Among them, the first user portrait will be used by the line control system in the production environment, while the second user portrait will only be temporarily stored for subsequent comparison and analysis and will not participate in the work of the production environment.
[0057] Step S300, obtaining a difference between the first user portrait and the second user portrait, and determining whether the difference is within an expected range.
[0058] Because the data sources are different, the format, structure and even handle of the data will be different. Therefore, even if the main data and the accompanying data have the same content, the output user portraits will be different due to the above differences.
[0059] Therefore, it is necessary to compare the first user portrait and the second user portrait to determine the difference between the two user portraits.
[0060] It should be noted that the data processed in this embodiment are user-related data. In the banking system, these data can be the user's loan amount, loan plan, loan interest, deposit amount, repayment history and other data. The risk control system generally generates a user portrait when the user applies for some risky business. For example, if a user wants to apply for a loan, the user portrait will be generated by extracting from the loan-related data. If a risky financial management business is handled, the deposit-related data will be obtained to generate a user portrait in order to conduct a risk assessment and determine whether the user is suitable for such risky business.
[0061] Therefore, the user portrait is actually a multi-dimensional data set, so by comparing the data in the two user portraits, the differences between them are determined to determine whether the backup data can be put into production.
[0062] Among them, the differences between the two user portraits have different types of differences, such as data offset, different values, missing data, and value errors. Some of these differences are not caused by program logic incompatibility. For example, the values are different, that is, the values in the accompanying data are correctly extracted, but they are different from the data in the main data, so the values in the user portraits are different in the end. This difference is a normal difference. The set of such normal differences is the preset expected range. As long as the differences are within the expected range, they are acceptable.
[0063] If the types of differences are not within the expected range, it means that these differences are caused by the mismatch between the program logic and the accompanying data or even a bug. This difference leads to an essential difference between the second user line drawing variable finally generated by the accompanying data and the first user portrait. This difference makes the accompanying data unable to participate in the work of the production environment.
[0064] The difference is to determine whether the same type of data is the same between the second user portrait and the first user portrait based on the first user portrait. That is, to determine whether the type of data in the first user portrait exists in the second user portrait, and to determine whether the values of the same type of data are the same.
[0065] For the same data, there is no need to process and record them. For different data, they need to be recorded as the difference of variables for subsequent analysis.
[0066] There are many types of differences as listed above. After finding the data that causes the difference, it is necessary to consider the user portrait globally to determine the type of difference.
[0067] For example, if two data values are found to be different, it is necessary to further determine the reason for the difference in the value. For example, if the wrong value is actually a value of another data type and is incorrectly filled in the current data type, data offset occurs. If the wrong value cannot find the source in the accompanying data, it is a numerical error. If the source is found and the data type of the source also matches, it means that only the value is different. In this way, the types of each difference can be determined one by one.
[0068] If all of the difference types are acceptable difference types, the difference is within the expected range; if there is any difference whose difference type is not within the expected range, the difference between the second user portrait and the first user portrait is not within the expected range.
[0069] Step S400: If it is not within the expected range, adjust the logic of the user portrait generation method according to the difference.
[0070] Therefore, if the above differences are not within the expected range, it is necessary to adjust the logic of the current user portrait generation method based on the differences.
[0071] Among them, the adjustment logic needs to be adjusted according to the type of difference.
[0072] First, it is necessary to locate the relevant processing logic of the current user portrait generation method according to the difference type; and modify the relevant processing logic so that the data of the second user portrait is the same as the data of the first user portrait.
[0073] The logic modification here must ensure that it will not affect the first user portrait, that is, the first user portrait should maintain the same result before and after the modification.
[0074] It should be noted that the above modification and comparison operations are carried out simultaneously with the normal production work of the risk control system. During this period, the new data source is used as accompanying data, and the output results do not participate in the production work, but only participate in the process of generating user portraits. Therefore, the above modification operations do not require separate planning time for modification, and the environment for generating the second user portrait is exactly the same as the real production environment, which can ensure that the comparison results and the modification of the user portrait generation logic are traceable.
[0075] Exemplarily, if the difference type is missing data, the missing data type is determined, and the relevant processing logic for identifying the data type is modified so that the data type can be correctly identified.
[0076] If the difference type is the numerical error, the data source of the current erroneous data is determined. If the data source exists, the relevant processing logic of data writing is modified. If the data source does not exist, the processing logic related to the numerical processing is modified.
[0077] Different types of differences have different causes. These causes are often that the data structure such as the format of the new data source is different from the master data, resulting in incompatibility of the local user portrait processing logic. Therefore, when determining the type of exception, it is also necessary to locate the corresponding user portrait logic and make modifications accordingly.
[0078] The modification here can be combined with the data structure of the new data source. For example, if the data is missing, the missing data type can be written into the user profile processing logic for identification. By analogy, most anomalies can be logically modified in a few fixed ways to achieve compatibility of the user profile logic with the new data source data.
[0079] Step S500: If it is within the expected range, it is determined that the first user portrait and the second user portrait are the same, and the data of the new data source is used as backup data.
[0080] If the above differences are all within the expected range, it can be considered that the first user portrait and the second user portrait are the same. At this time, it can be considered that the data of the new data source can be used in production work. Therefore, the new data source can be used as backup data. When the backup data needs to be called, the data of the new data source is called.
[0081] In order to ensure that the data of the new data source is reliable enough, a threshold can be set. For example, the first user profile must be the same as the second user profile 100 times before the new data source is considered to be ready for production. Otherwise, the data of the new data source will continue to be used as accompanying data for comparison and verification with the main data.
[0082] In the actual production environment, there may be a situation where the master data is called but the call fails. At this time, the backup data is needed, and the risk control system will switch the data source to use. After the above steps, the user profile generated by the data of the new data source is the same as the master data, and there will be no fundamental difference. Therefore, for users, it is actually not noticeable, and for production work, it will not affect it, which can ensure the stability of the entire work.
[0083] like Figure 2 As shown in the figure, a risk control process is shown. In the risk control process, if there is new data, a user portrait will be generated with the new data, and then the user portrait comparison will be performed. At this time, the risk control process will still work normally, and the user portrait generated by the master data will continue to be executed with the risk control process, and subsequent risk control strategy calls will be made, and risk control results will be given. For the user portrait generated by the new data, it is compared with the user u portrait, and the generation logic of the user portrait is adjusted according to the difference. This process of adjusting the logic is executed together with the main business, which saves time. At the same time, for new data, it generates user portraits in an actual production environment, which is more meaningful for reference.
[0084] The data smooth switching method of this embodiment is to run the new data source as a companion after the new data source is introduced, and then compare the user portrait generated based on the new data source with the user portrait generated by the master data. The user portrait generation logic is modified according to the difference, and the data of the new data source is used as backup data that can be put into production until the user portrait generated by the new data source is the same as the master data. This ensures that the new data can have sufficient adaptation operations from entering the system to entering production, and ensures that after the new data source enters the production environment, it will not generate a user portrait different from the master data, so that when the new data source is connected to the risk control system, the stability of the work can also be ensured.
[0085] Figure 3 A schematic diagram of the structure of a data smooth switching device according to an embodiment of the present application is shown. Exemplarily, the device includes:
[0086] The accompanying module 10 is used to use the data of the new data source as accompanying data when accessing the new data source;
[0087] A user portrait generation module 20 is used to synchronously call the accompanying data when the current main data is called, and adopt the same user portrait generation method to obtain a first user portrait of the current main data and a second user portrait of the accompanying data;
[0088] A judgment module 30 is used to obtain a difference between the first user portrait and the second user portrait, and determine whether the difference is within an expected range;
[0089] An adjustment module 40 is used to adjust the logic of the user portrait generation method according to the difference if it is not within the expected range;
[0090] The backup module 50 is configured to determine that the first user portrait and the second user portrait are the same if they are within the expected range, and use the data of the new data source as backup data.
[0091] The present application also provides a terminal device, the terminal device includes a processor and a memory, the memory stores a computer program, and the processor is used to execute the computer program to implement any one of the data smooth switching methods.
[0092] The present application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed on a processor, any one of the methods for smooth data switching is implemented.
[0093] It can be understood that the device of this embodiment corresponds to the method of the above embodiment, and the options in the above embodiment are also applicable to this embodiment, so they will not be described repeatedly here.
[0094] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU), a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or at least one of other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application.
[0095] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electric erasable programmable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor may execute the computer program accordingly after receiving an execution instruction.
[0096] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0097] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0098] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
[0099] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A data smooth switching method, characterized in that: include: When a new data source is connected, the data of the new data source is used as accompanying data; When the current master data is called, the accompanying data is synchronously called, and the same user portrait generation method is adopted to obtain the first user portrait of the current master data and the second user portrait of the accompanying data; Obtaining a difference between the first user portrait and the second user portrait, and determining whether the difference is within an expected range; If it is not within the expected range, adjusting the logic of the user portrait generation method according to the difference; If it is within the expected range, it is determined that the first user profile and the second user profile are the same, and the data of the new data source is used as backup data; The step of adjusting the logic of the user portrait generation method according to the difference includes: determining the difference type of the difference; According to the difference types, locate the relevant processing logic of the current user portrait generation method; Modifying the relevant processing logic so that the data of the second user portrait is the same as the data of the first user portrait; The types of differences include: missing data and numerical errors; The modifying the related processing logic includes: If the difference type is missing data, determining the missing data type, and modifying the relevant processing logic for identifying the data type so that the data type can be correctly identified; If the difference type is the numerical error, the data source of the current erroneous data is determined. If the data source exists, the relevant processing logic of data writing is modified. If the data source does not exist, the processing logic related to the numerical processing is modified.
2. The data smooth switching method according to claim 1, characterized in that: The obtaining a difference between the first user portrait and the second user portrait includes: Taking the first user portrait as a reference, determining whether the same type of data is the same between the second user portrait and the first user portrait; Determine all different data in the second user portrait and the first user portrait, where all the different data are the differences between the first user portrait and the second user portrait.
3. The data smooth switching method according to claim 1, characterized in that: Determining whether the difference is within an expected range includes: Determine the difference between different data types; If all of the difference types are acceptable difference types, it is determined that the difference is within the expected range; otherwise, it is determined that the difference is not within the expected range.
4. The data smooth switching method according to claim 1, characterized in that: The user portrait generation method includes: Performing format processing on the input data and extracting target feature data from the data; Data cleaning and logical processing are performed on each of the target feature data to obtain a user portrait.
5. The data smooth switching method according to claim 1, characterized in that: Also includes: When the current primary data fails to be called, the backup data is switched to be called, and a corresponding user portrait is generated according to the backup data.
6. A data smooth switching device, characterized in that: include: An accompanying module is used to use the data of a new data source as accompanying data when a new data source is accessed; A user portrait generation module is used to synchronously call the accompanying data when the current main data is called, and adopt the same user portrait generation method to obtain a first user portrait of the current main data and a second user portrait of the accompanying data; A judgment module, used to obtain a difference between the first user portrait and the second user portrait, and determine whether the difference is within an expected range; An adjustment module, used for adjusting the logic of the user portrait generation method according to the difference if it is not within the expected range; a backup module, configured to determine that the first user portrait and the second user portrait are the same if they are within the expected range, and use the data of the new data source as backup data; The step of adjusting the logic of the user portrait generation method according to the difference includes: determining the difference type of the difference; According to the difference types, locate the relevant processing logic of the current user portrait generation method; Modifying the relevant processing logic so that the data of the second user portrait is the same as the data of the first user portrait; The types of differences include: missing data and numerical errors; The modifying the related processing logic includes: If the difference type is missing data, determining the missing data type, and modifying the relevant processing logic for identifying the data type so that the data type can be correctly identified; If the difference type is the numerical error, the data source of the current erroneous data is determined. If the data source exists, the relevant processing logic of data writing is modified. If the data source does not exist, the processing logic related to the numerical processing is modified.
7. A terminal device, characterized in that: The terminal device comprises a processor and a memory, wherein the memory stores a computer program, and the processor is configured to execute the computer program to implement the data smooth switching method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer program is stored therein, and when the computer program is executed on a processor, the method for smooth data switching according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Differential data posterior method, device and equipment and storage medium
CN111831319A
Data file acquisition method and device based on block chain
CN113450114A
Topic user portrait processing method based on big data and artificial intelligence server
CN113590752A